Class pv.Format.number
Represents a number format, converting between a number and a
string. This class allows numbers to be formatted with variable
precision (both for the integral and fractional part of the number), optional
thousands grouping, and optional padding. The thousands (",") and decimal
(".") separator can be customized.
Defined in: NumberFormat.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Returns a default number format.
|
Method Attributes | Method Name and Description |
---|---|
format(x)
|
|
fractionDigits(min, max)
Sets or gets the minimum and maximum number of fraction digits.
|
|
integerDigits(min, max)
Sets or gets the minimum and maximum number of integer digits.
|
|
parse(x)
Parses the specified string as a number.
|
- Returns:
- {pv.Format.number} a number format.
- Parameters:
- {number} x
- Returns:
- {string}
If only one argument is specified to this method, this value is used as both the minimum and maximum number. If no arguments are specified, a two-element array is returned containing the minimum and the maximum.
- Parameters:
- {number} min Optional
- the minimum fraction digits.
- {number} max Optional
- the maximum fraction digits.
- Returns:
- {pv.Format.number} this, or the current fraction digits.
If only one argument is specified to this method, this value is used as both the minimum and maximum number. If no arguments are specified, a two-element array is returned containing the minimum and the maximum.
- Parameters:
- {number} min Optional
- the minimum integer digits.
- {number} max Optional
- the maximum integer digits.
- Returns:
- {pv.Format.number} this, or the current integer digits.
- Parameters:
- {string} x
- the string to parse.
- Returns:
- {number} the parsed number.