Java tutorial
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static String CalculatePraise(int num) { if (num > 1000) { double d = (double) num / 1000; DecimalFormat decimalFormat = new DecimalFormat("0.0"); return decimalFormat.format(d) + "K"; } return Integer.toString(num); } }