Java Utililty Methods Fraction Format

List of utility methods to do Fraction Format

Description

The list of methods to do Fraction Format are organized into topic(s).

Method

StringformatToString(Double v)
format To String
if (v == null) {
    return "";
try {
    DecimalFormat sos = new DecimalFormat("###.####");
    String s = sos.format(v);
    return s;
} catch (Exception e) {
...
StringformatTSYS(double tsys)
Format a TSYS value for display.
return dtok.format(tsys);
StringformatTwoDecimalsToStr(float num)
format Two Decimals To Str
DecimalFormat nf = new DecimalFormat();
nf.setMaximumFractionDigits(2);
return nf.format(num);
StringformatVersion(float versionNumber)
Format version number into #0.0 form
NumberFormat formatter = new DecimalFormat("#0.0");
return formatter.format(versionNumber);
StringformatWithOneDecimal(Float value)
format With One Decimal
if (value == null) {
    return "";
return oneDecimalFormat.format(value);