public static String parseIntToMetricSuffix(int x){
  String xint=String.valueOf(x);
  if (xint.endsWith("000000")) {
    xint=xint.replaceAll("000000$","M");
  }
 else   if (xint.endsWith("000")) {
    xint=xint.replaceAll("000$","k");
  }
  return xint;
}

public static String parseIntToMetricSuffix ( int x ) { String xint = String . valueOf ( x ) ; if ( xint . endsWith ( "000000" ) ) { xint = xint . replaceAll ( "000000$" , "M" ) ; } else if ( xint . endsWith ( "000" ) ) { xint = xint . replaceAll ( "000$" , "k" ) ; } return xint ; }
convert 000 and 000 , 000 to k and m suffix . e . g . 1000 - > " 1k " ; 123000000 - > 123m see also roundtosignificantfigures ( ) to round numbers .
