List of utility methods to do Fraction Format
String | format(double val) Format decimals to 4 digits only return new String(df.format(val)); |
String | format(double val) format return format(val, DEFAULT_NUMBER_DIGIT); |
String | format(double val) format if (Double.isNaN(val)) { return "?"; double absVal = Math.abs(val); if (absVal > 1) formatter.setMaximumFractionDigits(1); else { double log = Math.log10(absVal); ... |
String | format(double value) format return format.format(value);
|
String | format(double value) Format a map scale into a string return String.format("%s%s", SCALE_PREFIX, NumberFormat.getIntegerInstance().format((int) value)); |
String | format(double value) format final Double doubleValue = new Double(value); final int intValue = doubleValue.intValue(); if (intValue == value) { return Integer.toString(intValue); return FORMATTER.format(value); |
String | format(double value) format value = round(value); NumberFormat format = NumberFormat.getNumberInstance(); format.setMinimumFractionDigits(2); format.setMaximumFractionDigits(2); return format.format(value).replaceAll(",", ""); |
String | format(double value) format DecimalFormat format = new DecimalFormat("0.00"); DecimalFormatSymbols instance = DecimalFormatSymbols.getInstance(); instance.setDecimalSeparator('.'); format.setDecimalFormatSymbols(instance); return format.format(value); |
String | format(double value, double unit) format int dotIndex = (unit + "").indexOf('.'); if (dotIndex == -1) { return value + ""; } else { int dotDigits = (unit + "").length() - dotIndex - 1; String pattern = "#."; for (int i = 0; i < dotDigits; i++) { pattern += "0"; ... |
String | format(double value, int decimalPlace) Format the given value to the number of decimal places specified. NumberFormat nft = NumberFormat.getInstance();
nft.setMinimumFractionDigits(decimalPlace);
nft.setMaximumFractionDigits(decimalPlace);
return nft.format(value);
|