Number data type
The number data type is used to represent a precise numerical value.
Value range
The largest possible value is +/-79,228,162,514,264,337,593,543,950,335 (+/-7.9228162514264337593543950335E+28). With 28 decimal places, the largest value is +/-7.9228162514264337593543950335, and the smallest non-zero value is +/-0.0000000000000000000000000001 (+/-1E-28).
Precision
The number data type is not a floating-point data type. A number should be considered an integer value with an associated sign and integer scaling factor. It has a more precise representation in memory than floating-point types.
Literals
A number value can be expressed as a literal using the (-12.345) syntax.
Examples: (123), (2.99), (-13), (-45.67)
The literal can be followed by a method in the same way a variable can. For example: (1.99).Floor
Methods
| Name | Description | Return type |
|---|---|---|
| Add | Adds this number to a specified number. | Number |
| Ceiling | Returns the smallest integral value that is greater than or equal to this number. | Number |
| Divide | Divides this number (dividend) with a specified number (divisor). | Number |
| Encrypt | Encrypts this number. | Text |
| Equals | Returns a value indicating whether this number is equal to another specified number. | Boolean |
| Floor | Rounds this number to the closest integer toward negative infinity. | Number |
| GreaterThan | Returns a value indicating whether this number is greater than another specified number. | Boolean |
| GreaterThanOrEquals | Returns a value indicating whether this number is greater than or equal to another specified number. | Boolean |
| Integral | Returns the integral part of this number. | Number |
| LessThan | Returns a value indicating whether this number is less than another specified number. | Boolean |
| LessThanOrEquals | Returns a value indicating whether this number is less than or equal to another specified number. | Boolean |
| Mod | Divides this number (dividend) with a specified number (divisor) and returns only the remainder. | Number |
| Multiply | Multiplies this number with a specified number. | Number |
| Negate | Returns the result of multiplying this number by negative one. | Number |
| Pluralise | Returns a plural suffix if the value is not 1. | Text |
| Round | Rounds this number to a specified precision. | Number |
| Subtract | Subtracts a specified number from this number. | Number |
| ToPrice | Returns a text value that represents a currency amount. | Number |
| ToText | Returns the equivalent text representation. | Text |