Double Module
Parses a float from text, checks whether a float is valid, rounds a float to significant digits, converts a float to a fraction and formats a float as a Dutch number.
Functions and values
| Function or value |
Description
|
Full Usage:
Double.fixPrecision n f
Parameters:
int
f : float
Returns: float
|
Fix the precision of a float f to match a minimum of non zero digits n * 66.666 |> fixPrecision 1 = 67 * 6.6666 |> fixPrecision 1 = 7 * 0.6666 |> fixPrecision 1 = 0.7 * 0.0666 |> fixPrecision 1 = 0.07 * 0.0666 |> fixPrecision 1 = 0.07 * 0.0666 |> fixPrecision 2 = 0.067 * 0.0666 |> fixPrecision 3 = 0.0666 * 6.6666 |> fixPrecision 1 = 7 * 6.6666 |> fixPrecision 2 = 6.7 * 6.6666 |> fixPrecision 3 = 6.67 etc If n < 0 then the value is not changed.
|
Full Usage:
Double.floatHasDecimals v
Parameters:
float
Returns: bool
|
Check whether a float has any decimal digits
|
|
|
Full Usage:
Double.getPrecision n f
Parameters:
int
f : float
Returns: int
|
Calculates the number of decimal digits that should be shown according to a precision number n that specifies the number of non zero digits in the decimals. * 66.666 |> getPrecision 1 = 0 * 6.6666 |> getPrecision 1 = 0 * 0.6666 |> getPrecision 1 = 1 * 0.0666 |> getPrecision 1 = 2 * 0.0666 |> getPrecision 0 = 0 * 0.0666 |> getPrecision 1 = 2 * 0.0666 |> getPrecision 2 = 3 * 0.0666 |> getPrecision 3 = 4 * 6.6666 |> getPrecision 0 = 0 * 6.6666 |> getPrecision 1 = 0 * 6.6666 |> getPrecision 2 = 1 * 6.6666 |> getPrecision 3 = 2 etc If n < 0 then n = 0 is used.
|
Full Usage:
Double.isInfinity n
Parameters:
float
Returns: bool
|
Check whether a Double is positive or negative infinity
|
Full Usage:
Double.isNaN d
Parameters:
float
Returns: bool
|
Check whether a Double is a NaN value
|
Full Usage:
Double.isValid n
Parameters:
float
Returns: bool
|
Check whether a Double is valid
|
Full Usage:
Double.parse s
Parameters:
string
Returns: float
|
Get the double value of a string using InvariantCulture
|
Full Usage:
Double.roundingDecimals n f
Parameters:
int
f : float
Returns: int
|
Returns the number of decimals that f is rounded to for n significant digits. The number is at most 15, because Math.Round takes at most 15 decimals for a float.
|
Full Usage:
Double.stringToFloat32 s
Parameters:
string
Returns: float32
|
Get a float32 from a string returns a 0 value when the string cannot be parsed
|
Full Usage:
Double.toStringNumberNL p n
Parameters:
string
n : float
Returns: string
|
Returns a string representation of a float in Dutch format, with a decimal comma and a narrow no-break space between the thousands.
|
Full Usage:
Double.toStringNumberNLWithoutTrailingZeros f
Parameters:
float
Returns: string
|
Formats f as a Dutch number with at least 3 significant digits and without trailing zeros.
|
Full Usage:
Double.toStringNumberNLWithoutTrailingZerosFixPrecision n f
Parameters:
int
f : float
Returns: string
|
Formats f as a Dutch number with at least n significant digits and without trailing zeros. A negative n counts as 15, the most significant digits that a float holds exactly. Example: 0.0666 with n = 2 gives "0,067".
|
Full Usage:
Double.tryParse s
Parameters:
string
Returns: float option
|
Get the finite float a string holds, read with the float number style and the invariant culture: none for a decimal comma, a thousands separator, a currency sign, parentheses, not a number, an infinity or an overflow. Spaces around the number are allowed.
|
GenPRES