Class DecimalFormatter

java.lang.Object
org.mozilla.javascript.dtoa.DecimalFormatter

public class DecimalFormatter extends Object
  • Constructor Details

    • DecimalFormatter

      public DecimalFormatter()
  • Method Details

    • toExponential

      public static String toExponential(double v, int fractionDigits)
      The algorithm of Number.prototype.toExponential. If fractionDigits is invalid input: '<' 0, then it indicates the special case that the value was previously undefined, which calls for a different precision for the calculation.
    • toFixed

      public static String toFixed(double v, int fractionDigits)
      The algorithm of Number.prototype.toFixed(fractionDigits).
    • toPrecision

      public static String toPrecision(double v, int precision)
      The algorithm of Number.prototype.toPrecision()