Attributes | Name and Description |
---|---|
|
caplin.core.Number()
|
Attributes | Name and Description |
---|---|
<static>
|
boolean
isNumber(Object n)
|
<static>
|
Number
log10(Number n)
Logarithm to base 10. |
<static>
|
String
pad(Number nValue, Number nLength)
Pads the integer part of a number with zeros to reach the specified length. |
<static>
|
Number
round(Number n)
Rounds a floating point number |
<static>
|
int
sgn(Number n)
Returns a numeric representation of the sign on the number. |
<static>
|
String
toFixed(Number n, Number nDp)
Formats the number to the specified number of decimal places. |
<static>
|
String
toPrecision(Number n, Number nSf)
Formats the number to the specified number of significant figures. |
<static>
|
String
toRounded(Number n, Number nRounding)
Formats the number to the specified number of decimal places, omitting any trailing zeros. |
►
caplin.core.Number()
►
<static>
boolean
isNumber(Object n)
Object | n |
►
<static>
Number
log10(Number n)
Logarithm to base 10.
Number | n | The number (or a number as a string) |
►
<static>
String
pad(Number nValue, Number nLength)
Pads the integer part of a number with zeros to reach the specified length.
Number | nValue | The number (or a number as a string) |
Number | nLength | The required length of the number |
►
<static>
Number
round(Number n)
Rounds a floating point number
Number | n | The number (or a number as a string) |
►
<static>
int
sgn(Number n)
Returns a numeric representation of the sign on the number.
Number | n | The number (or a number as a string) |
►
<static>
String
toFixed(Number n, Number nDp)
Formats the number to the specified number of decimal places.
Number | n | The number (or a number as a string) |
Number | nDp | The number of decimal places |
►
<static>
String
toPrecision(Number n, Number nSf)
Formats the number to the specified number of significant figures. This fixes the bugs in the native Number function of the same name that are prevalent in various browsers. If the number of significant figures is less than one, then the function has no effect.
Number | n | The number (or a number as a string) |
Number | nSf | The number of significant figures |
►
<static>
String
toRounded(Number n, Number nRounding)
Formats the number to the specified number of decimal places, omitting any trailing zeros.
Number | n | The number (or a number as a string) |
Number | nRounding | The number of decimal places to round |