Fixed128 Data Type

Holds signed 128-bit (16-byte) fixed-point values with a default range −17,0141,1834,6046,923,173,168,730,371.5884105728 – +17,0141,1834,6046,923,173,168,730,371.5884105727.

Instructions

Default value
When you declare a variable of type Fixed128 and do not initialize it,, its default value is zero (¤0.0).
Coercion
Fixed128 widens to Real32, Real64, Real, or Real128 without risk of overflow.
Type characters
Fixed128 has no type characters.

Fixed128 literal

@ [ symbol ] integer_part [ . fractional_part ]
or
¤ integer_part [ . fractional_part ]

Parts

symbol
Optional one character. Some permitted symbols are: $, , £, and ¥.
these symbols are ignored by the compiler. If you use a symbol, use the same one in all of your code.
integer_part
One to 38 decimal digits. For the default number of decimal places, the maximum is 29 digits. You can use an underscore (_) to divide it into groups of digits.
fractional_part
One to 39 decimal digits. For the default number of decimal places, the maximum is 10 digits. Any additional digits are ignored.

Constructors

Fixed128(Optional places As Int = 10)
places specifies the number of places to the right of the decimal point. It must be between 1 and 39. The default is 10.

Shared methods and properties

Fixed128.Bits As Int
Returns 128.
Fixed128.Default As Fixed128
Returns the default value, ¤0.0.
Fixed128.Epsilon(Optional x As Fixed128) As Fixed128
Returns the smallest value greater than ¤0.0. If x is not given, it returns ¤0.0000000001.
Fixed128.Max(Optional x As Fixed128) As Fixed128
Returns the largest positive value for x. If x is not given, it returns ¤17_0141_1834_6046_923_173_168_730_371.5884105727.
Fixed128.Min(Optional x As Fixed128) As Fixed128
Returns the smallest negative value for x. If x is not given, it returns −¤17_0141_1834_6046_923_173_168_730_371.5884105728.
Fixed128.Parse(str As String, Optional #fmt As Format) As Fixed128
Tries to parse a string that shows as a number.
If #fmt is not given or is #Null, then it uses the format of the local culture. Or you can be explicit with Format.#UserLocale.

Examples

Dim price As Fixed128 = @$1_199.99

See also