Interface CSSNumberValue

All Superinterfaces:
Cloneable, CSSPrimitiveValue, CSSTypedValue, CSSValue
All Known Implementing Classes:
NumberValue, PercentageValue

public interface CSSNumberValue extends CSSTypedValue
A value that is a number with an optional unit.
  • Method Details

    • setCalculatedNumber

      void setCalculatedNumber(boolean calculated)
      Sets whether this number is the result of a calculation.
      Parameters:
      calculated - true if this number was calculated.
    • roundToInteger

      void roundToInteger() throws DOMException
      Round this value to the nearest integer.
      Throws:
      DOMException - TYPE_MISMATCH_ERR if this value is not a plain <number>.
    • setMaximumFractionDigits

      default void setMaximumFractionDigits(int maxFractionDigits)
      If this object uses a fixed format for serialization, set the maximum fraction digits to use when it was not specified or is the result of a calculation.

      If the implementation does not use a fixed format, does nothing.

      Parameters:
      maxFractionDigits - the maximum fraction digits.