Inherits ScriptObject.
Public Attributes | |
Integer | decimals |
The number of decimals. | |
Boolean | trimZeroDecimals |
The trailing zero decimals should be skipped. Deprecated since r45877. | |
Boolean | trimLeadZero |
The leading zero should be excluded. Eg. ".123" instead of "0.123". Deprecated since r45877. | |
Boolean | zeroPad |
The returned string should be padded with zeros to fit the width. Deprecated since r45877. | |
Integer | width |
The minimum width of the formattedd number. Deprecated since r45877. | |
Integer | minDigitsLeft |
The minumum digits to the left of decimal point to output. Since r45877. | |
Integer | minDigitsRight |
The minumum digits to the right of decimal point to output. Since r45877. | |
Integer | type |
The format type: FORMAT_REAL, FORMAT_INTEGER, FORMAT_LZS, FORMAT_TZS. Since r45877. | |
Integer | decimalSymbol |
The decimal symbol. | |
Boolean | forceSign |
Forces the '+' sign on positive numbers. | |
Boolean | forceDecimal |
Forces the decimal separator in the formatted number. Deprecated since r45877. | |
Number | cyclicLimit |
The cyclic limit. Deprecated since r45877. | |
Integer | cyclicSign |
The cyclic sign. Only valid if cyclicLimit > 0. Deprecated since r45877. | |
Number | scale |
The scaling factor for the output number. | |
Number | offset |
The offset for the output number. | |
Number | base |
The minimum increment to output. Since r45877. | |
Number | minimum |
The unsigned minimum value. Since r45877. | |
Number | maximum |
The unsigned maximum value. Since r45877. | |
String | prefix |
The prefix. | |
String | suffix |
The suffix. | |
This class converts numbers into strings in accordance with several modifiers.
When value remapping is enabled the cyclic mapping is done first, then the scaling, and finally the offset.
FormatNumber | ( | ) |
Constructs a number formatting object.
Returns true if the specified values are different when formatted.
Number getBase | ( | ) |
Returns the base number.
Number getCyclicLimit | ( | ) |
Returns the cyclic limit. Deprecated since r45877.
Integer getCyclicSign | ( | ) |
Returns the cyclic sign. Deprecated since r45877.
Integer getDecimalSymbol | ( | ) |
Returns the decimal separator.
Boolean getForceDecimal | ( | ) |
Returns the force decimal flag. Deprecated since r45877.
Boolean getForceSign | ( | ) |
Returns the force sign flag.
Number getMaximum | ( | ) |
Returns the maximum allowed value.
Integer getMinDigitsLeft | ( | ) |
Returns the minimum number of digits to the left of the decimal point.
Integer getMinDigitsRight | ( | ) |
Returns the minimum number of digits to the right of the decimal point.
Number getMinimum | ( | ) |
Returns the minimum allowed value.
Number getMinimumValue | ( | ) |
Returns the minimum epsilon value.
Integer getNumberOfDecimals | ( | ) |
Returns the number of decimals.
Number getOffset | ( | ) |
Returns the offset.
String getPrefix | ( | ) |
Returns the prefix.
Number getScale | ( | ) |
Returns the scale.
String getSuffix | ( | ) |
Returns the suffix.
Boolean getTrimLeadZero | ( | ) |
Returns true if the leading zero should be skipped. Deprecated since r45877.
Boolean getTrimZeroDecimals | ( | ) |
Returns true if the suffix zero decimals should be skipped. Deprecated since r45877.
Integer getType | ( | ) |
Returns the type of formatted value.
Integer getWidth | ( | ) |
Returns the width. Deprecated since r45877.
Boolean getZeroPad | ( | ) |
Returns the zero padding mode. Deprecated since r45877.
Returns true if the specified value would be non-zero when formatted. When comparing 2 values use areDifferent() instead.
setBase | ( | Number | base | ) |
Sets the base number.
Sets the cyclic mapping.
limit | Specifies the cyclic limit. Must be positive or 0. Cyclic mapping will be disabled when set to 0. |
sign | Specifies the sign. Must in -1, 0, or 1. |
For sign -1 the values will be mapped to the range [-cyclicLimit; 0] For sign 0 the values will be mapped to the range [-cyclicLimit; cyclicLimit] For sign 1 the values will be mapped to the range [0; cyclicLimit]
The cyclic mapping is done before scaling and offset. Deprecated since r45877.
setDecimalSymbol | ( | Integer | decimalSymbol | ) |
Sets the decimal separator.
setForceDecimal | ( | Boolean | forceDecimal | ) |
Sets the force decimal flag. Deprecated since r45877.
setForceSign | ( | Boolean | forceSign | ) |
Sets the force sign flag.
setMaximum | ( | Number | value | ) |
Sets the maximum allowed value.
setMinDigitsLeft | ( | Integer | value | ) |
Sets the minimum number of digits to the left of the decimal point.
setMinDigitsRight | ( | Integer | value | ) |
Sets the minimum number of digits to the right of the decimal point.
setMinimum | ( | Number | value | ) |
Sets the minimum allowed value.
setNumberOfDecimals | ( | Integer | numberOfDecimals | ) |
Sets the number of decimals.
setOffset | ( | Number | offset | ) |
Sets the offset.
setPrefix | ( | String | prefix | ) |
Sets the prefix.
setScale | ( | Number | scale | ) |
Sets the scale.
setSuffix | ( | String | suffix | ) |
Sets the suffix.
setTrimLeadZero | ( | Boolean | trimLeadZero | ) |
Sets the skip leading zero flag. Deprecated since r45877.
setTrimZeroDecimals | ( | Boolean | trimZeroDecimals | ) |
Sets the skip zero decimals flag. Deprecated since r45877.
setType | ( | Integer | type | ) |
Sets the type of formatted value. Can be FORMAT_INTEGER, FORMAT_REAL, FORMAT_LZS, FORMAT_TZS.
setWidth | ( | Integer | width | ) |
Sets the width. Deprecated since r45877.
setZeroPad | ( | Boolean | zeroPad | ) |
Sets zero padding mode. Deprecated since r45877.