- All Superinterfaces:
Cloneable
,CSSPrimitiveValue
,CSSTypedValue
,CSSValue
- All Known Implementing Classes:
NumberValue
,PercentageValue
A value that is a number with an optional unit.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.sf.carte.doc.style.css.CSSValue
CSSValue.CssType, CSSValue.Type
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Round this value to the nearest integer.void
setCalculatedNumber
(boolean calculated) Sets whether this number is the result of a calculation.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.Methods inherited from interface io.sf.carte.doc.style.css.CSSPrimitiveValue
getUnitType, isNegativeNumber, isPrimitiveValue, setExpectInteger
Methods inherited from interface io.sf.carte.doc.style.css.CSSTypedValue
clone, getFloatValue, getFloatValue, getStringValue, isCalculatedNumber, isNumberZero, setFloatValue, setStringValue, toRGBColor, toRGBColorValue
Methods inherited from interface io.sf.carte.doc.style.css.CSSValue
getCssText, getCssValueType, getMinifiedCssText, getMinifiedCssText, getPrecedingComments, getPrimitiveType, getTrailingComments, matches, setCssText, writeCssText
-
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
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.
-