List of utility methods to do Fraction Format
String | formatDecimals(double number) format Decimals return new DecimalFormat().format(number); |
String | formatDecNumber(Double number, String pattern) format Dec Number DecimalFormat decimalFormat = new DecimalFormat(); decimalFormat.setDecimalSeparatorAlwaysShown(false); if (number == null) { number = 0.0; if (pattern == null || "".equals(pattern)) { pattern = NUMBER_PATTERN_1; } else { ... |
String | formatDegToDms(double degrees, double min, double max) format Deg To Dms String s = ""; double deg = normalizeAngle(degrees, min, max); if (deg < 0) { deg = Math.abs(deg); s += "-"; double arcmin = (deg - (int) deg) * 60.0; double arcsec = (arcmin - (int) arcmin) * 60.0; ... |
String | formatDisplay(Double value) format Display return DECIMAL_FORMAT.format(value);
|
String | formatDistance(float distance) Formatea la distancia con 2 decimales DecimalFormat df = new DecimalFormat("###.##"); return df.format(distance) + " m"; |
String | formatDollarAmount(float amount) format Dollar Amount return decimalFormat.format(amount);
|
String | formatDoube(double val) This method is used to format the value to 2 decimal places if val is 800.0 then this method will return 800.00 if val is 800.136 then this method will return 800.14 return doubleStringFormat.format(String.valueOf(val)); |
String | formatDouble(DecimalFormat fmt, double value) format Double if (Double.isNaN(value)) { return "NaN"; } else if (Double.isInfinite(value)) { if (value > 0) { return "+Inf"; } else { return "-Inf"; } else { return fmt.format(value); |
String | formatDouble(Double amount, String format) format Double DecimalFormat formatter = new DecimalFormat(format); return formatter.format(amount); |
String | formatDouble(double aValue) format Double DecimalFormat formatter = new DecimalFormat(); formatter.setGroupingUsed(false); formatter.setMinimumIntegerDigits(1); formatter.setMaximumFractionDigits(100); formatter.setRoundingMode(RoundingMode.DOWN); DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols(); symbols.setDecimalSeparator('.'); formatter.setDecimalFormatSymbols(symbols); ... |