Class PluralRules.FixedDecimal

    • Field Detail

      • source

        public final double source
      • isNegative

        public final boolean isNegative
    • Constructor Detail

      • FixedDecimal

        public FixedDecimal​(double n,
                            int v,
                            long f)
        Parameters:
        n - is the original number
        v - number of digits to the right of the decimal place. e.g 1.00 = 2 25. = 0
        f - Corresponds to f in the plural rules grammar. The digits to the right of the decimal place as an integer. e.g 1.10 = 10
      • FixedDecimal

        public FixedDecimal​(double n,
                            int v)
      • FixedDecimal

        public FixedDecimal​(double n)
      • FixedDecimal

        public FixedDecimal​(long n)
      • FixedDecimal

        public FixedDecimal​(java.lang.String n)
    • Method Detail

      • getSource

        public double getSource()
      • getVisibleDecimalDigitCount

        public int getVisibleDecimalDigitCount()
      • getVisibleDecimalDigitCountWithoutTrailingZeros

        public int getVisibleDecimalDigitCountWithoutTrailingZeros()
      • getDecimalDigits

        public long getDecimalDigits()
      • getDecimalDigitsWithoutTrailingZeros

        public long getDecimalDigitsWithoutTrailingZeros()
      • getIntegerValue

        public long getIntegerValue()
      • isHasIntegerValue

        public boolean isHasIntegerValue()
      • isNegative

        public boolean isNegative()
      • getBaseFactor

        public int getBaseFactor()
      • decimals

        public static int decimals​(double n)
        Return a guess as to the number of decimals that would be displayed. This is only a guess; callers should always supply the decimals explicitly if possible.
      • equals

        public boolean equals​(java.lang.Object arg0)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hasIntegerValue

        public boolean hasIntegerValue()
      • intValue

        public int intValue()
        Specified by:
        intValue in class java.lang.Number
      • longValue

        public long longValue()
        Specified by:
        longValue in class java.lang.Number
      • floatValue

        public float floatValue()
        Specified by:
        floatValue in class java.lang.Number
      • doubleValue

        public double doubleValue()
        Specified by:
        doubleValue in class java.lang.Number
      • getShiftedValue

        public long getShiftedValue()