Format a double single fraction digit.

@param n
@return
969905
private String format(double n) {
        NumberFormat nf = NumberFormat.getNumberInstance(Locale.ENGLISH);
        nf.setMaximumFractionDigits(1);
        nf.setGroupingUsed(false);
        return nf.format(n);
    }
1280595
public String shortOrdinal(long n) {
        String str = Long.toString(n);

        if (n < 0) {
            n = -n;
        }

        n %= 100;

        if (n >= 10 && n <= 20) {
            str = str.concat("th");
        }
        else {
            if (n > 20) n %= 10;

            switch ((int) n) {
            case 1:
                str = str.concat("st"); break;
            case 2:
                str = str.concat("nd"); break;
            case 3:
                str = str.concat("rd"); break;
            default:
                str = str.concat("th"); break;
            }
        }

        return str;
    }
314783
public static String convert( long x, int n, String d ) {
        if (x == 0) {
            return "0";
        }

        String r = "";
        int m = 1 << n;
        m--;
        while( x != 0 ) {
            r = d.charAt((int) (x & m)) + r;
            x = x >>> n;
        }
        return r;
    }
488056
function Fraction(n, d) {
	if(typeof(d) === "number") {
		this.denominator = d;
	} else {
		this.denominator = 1;
	}
	if(typeof(n) === "number") {
		this.numerator = n;
	} else if(typeof(n) === "string") {
		let slash = n.indexOf('/');
		if(slash > 0) {
			/**
			 *	The numerator of the fraction.
			 *
			 *	@type {number}
			 */
			this.numerator = Number.parseInt(n.substring(0, slash));
			/**
			 *	The denominator of the fraction.
			 *
			 *	@type {number}
			 *	@defaultvalue 1
			 */
			this.denominator = Number.parseInt(n.substring(slash + 1));
		} else {
			this.numerator = Number.parseFloat(n);
		}
	} else if((typeof(n) === "object") && (n instanceof Fraction)) {
		this.numerator = n.numerator;
		this.denominator = n.denominator;
	} else {
		throw new TypeError(`${n} must be a number or a string`);
	}
	/**
	 *	The numeric value of the fraction i.e., numerator divided by denominator.
	 *
	 *	@type {number}
	 */
	this.value = this.numerator / this.denominator;
}
1264588
public final String format(android.icu.math.BigDecimal number) {
        return format(number, new StringBuffer(),
                      new FieldPosition(0)).toString();
    }
272154
public String getIntegerPart(final int digit) {
        
        final int length = integerPart.length();
        if(length < digit || digit <= 0) {
            return "";
        }
        
        String num = String.valueOf(integerPart.charAt(length - digit));
        if(isUseSeparator()) {
            if(digit >= 4 && (digit-1) % 3 == 0) {
                num += ",";
            }
        }
        
        return num;
        
    }
1107705
private String formatUnits(Number value)
   {
      return (value == null ? null : m_formats.getUnitsDecimalFormat().format(value.doubleValue() / 100));
   }
333752
private String convertDecimal(double d, String format)
    {
        String ret = "";

        if(format.length() > 0)
        {
            DecimalFormat f = new DecimalFormat(format);
            ret = f.format(d);
        }
        else
        {
            ret = Double.toString(d);
        }

        return ret;
    }
735002
function(digits, n) {
		n = n.toString();
		while(n.length < digits)
		n = '0' + n;
		return n;
	}
589207
public <N extends Number> CellFormatResult format(final String formatPattern, final N value, final Locale locale) {
        return format(new NumberCell<N>(value, formatPattern), locale);
    }
1141942
public float multipliedBy (Fraction fraction)
  {
    int newNumerator = numerator * fraction.getNumerator();
    int newDenominator = denominator * fraction.getDenominator();
    return (newNumerator/newDenominator);
  }
800883
private static String formatInt(int number) {
        String str = Integer.toString(number);
        return number < 10 ? " " + str : str;
    }
87499
public static DoubleMatrix identity(int n)
    {
        return getInstance(n ,n, (i, j) -> i == j ? 1 : 0);
    }
394781
function(val, fractionDigits)
    {
      return val == null || val === "" ? 0 : formatNumber(val,
      {
        minimumFractionDigits: fractionDigits == null ? 0 : fractionDigits,
        maximumFractionDigits: fractionDigits == null ? maximumFractionDigits : fractionDigits
      })
    }
1246716
public static String formatDouble(final Double amount, String pattern) {
		if (pattern == null || pattern.equals("")) {
			pattern = JKFormatUtil.DEFAULT_DOUBLE_FORMAT;
		}
		return JKFormatUtil.getNumberFormatter(pattern).format(amount);
	}
820818
public static String doubleToString(double d) {
        if (Double.isInfinite(d) || Double.isNaN(d)) {
            return "null";
        }

// Shave off trailing zeros and decimal point, if possible.

        String string = Double.toString(d);
        if (string.indexOf('.') > 0 && string.indexOf('e') < 0
                && string.indexOf('E') < 0) {
            while (string.endsWith("0")) {
                string = string.substring(0, string.length() - 1);
            }
            if (string.endsWith(".")) {
                string = string.substring(0, string.length() - 1);
            }
        }
        return string;
    }
1112457
public static String calculateCheckDigit(final String iban) throws IbanFormatException {
        final String reformattedIban = replaceCheckDigit(iban,
                Iban.DEFAULT_CHECK_DIGIT);
        final int modResult = calculateMod(reformattedIban);
        final int checkDigitIntValue = (98 - modResult);
        final String checkDigit = Integer.toString(checkDigitIntValue);
        return checkDigitIntValue > 9 ? checkDigit : "0" + checkDigit;
    }