public static String shortNumber(int number){
  if (number >= 1000) {
    int hundred=number % 1000 / 100;
    if (hundred != 0)     return String.format("%.1f",number / 1000) + "k";
 else     return (number / 1000) + "k";
  }
 else   return number + "";
}

public static String shortNumber ( int number ) { if ( number >= 1000 ) { int hundred = number % 1000 / 100 ; if ( hundred != 0 ) return String . format ( "%.1f" , number / 1000 ) + "k" ; else return ( number / 1000 ) + "k" ; } else return number + "" ; }
1000 - > 1k , 1100 - > 1 . 1k
