List of utility methods to do Fraction Format
String | format(float number, int bitCount) format String result = ""; String strbit = ""; for (int i = 0; i < bitCount; i++) { strbit += "0"; java.text.DecimalFormat df = new java.text.DecimalFormat("#." + strbit); result = df.format(number); return result; ... |
String | format(float totalNumberOfFreeBytes) format NumberFormat format = NumberFormat.getInstance(); format.setMaximumFractionDigits(1); format.setMinimumFractionDigits(0); if (totalNumberOfFreeBytes < 1024) return format.format(totalNumberOfFreeBytes) + " Bytes"; totalNumberOfFreeBytes = totalNumberOfFreeBytes / 1024; if (totalNumberOfFreeBytes < 1024) return format.format(totalNumberOfFreeBytes) + " KB"; ... |
String | format(float value) Formats a floating point value with useful default rules; ie. return _ffmt.format(value);
|
String | format(NumberFormat nf, float number, float defaultValue) format if ((Float.isNaN(number)) || (Float.isInfinite(number))) { return nf.format(defaultValue); } else { return nf.format(number); |
String | format0(Double d) format if (d == null) return ""; return df0.format(d); |
String | format2Double(Double amount) format Double return formatDouble(amount, "0.00"); |
String | formatAmount(double amount) format Amount NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(0);
nf.setGroupingUsed(false);
return nf.format(amount);
|
String | formatAmount(Double amount) format Amount return String.format("%.2f", amount); |
String | formatAmount(double number) Creates a formatted string from the number input. NumberFormat numberFormatter = NumberFormat.getCurrencyInstance();
String formattedString = numberFormatter.format(number);
return formattedString;
|
String | formatAmount(final double mark) Format amount. final DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance(); format.setMaximumFractionDigits(2); return format.format(mark); |