public static String scaleToString ( double scale , int precision , int significantDigits ) { NumberFormat numberFormat = NumberFormat . getFormat ( "###,###" ) ; if ( scale > 0 && scale < 1.0 ) { int denominator = round ( ( int ) Math . round ( 1.0 / scale ) , precision , significantDigits ) ; return "1 : " + numberFormat . format ( denominator ) ; } else if ( scale >= 1.0 ) { int nominator = round ( ( int ) Math . round ( scale ) , precision , significantDigits ) ; return numberFormat . format ( nominator ) + " : 1" ; } else { return ERROR_SCALE ; } }
Convert a scale to a string representation .