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).
Automatic conversions
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, then use the same one in all of your code.
integer_part
One to 38 decimal digits. For the default number of decimal digits, 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 digits, the maximum is 10 digits. All digits after that are ignored.

Constructors

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

Shared methods and properties

Fixed128.Default As Fixed128
Returns the default value, ¤0.0.
Fixed128.Epsilon(Optional x As Fixed128) As Fixed128
Returns the smallest value more than ¤0.0. If x is not given, then it returns ¤0.0000000001.
Fixed128.Max(Optional x As Fixed128) As Fixed128
Returns the largest positive value for x. If x is not given, then 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, then it returns −¤17_0141_1834_6046_923_173_168_730_371.5884105728.
Fixed128.Parse(str As String, Optional #format As Format) As Fixed128
Tries to parse a string that shows as a number.
If #format is not given or is #Null, then it uses the format of the local culture. Or you can make it clear with Format.UserLocale.
Fixed128.Size As Int
Returns the number of available bytes. This is always 16.

Examples

Dim price As Fixed128 = @$1_199.99

See also