Fixed64 Data Type

Holds signed 64-bit (8-byte) fixed-point values with a default maximum of 15 digits to the left of the decimal point and 3 to the right. That is a range of −922,337,203,685,477.5808 – +922,337,203,685,477.5807.

Instructions

Default value
When you declare a variable of type Fixed64 and do not initialize it, its default value is zero (¤0.0).
Automatic conversions
Fixed64 widens to Real32, Real64, Real128, or Fixed128 without risk of overflow.
Type characters
You can put the suffix d64 (or D64) on the end of a number literal. And you can put the at-symbol (@) on the end of a name or number.

Fixed64 literal

prefix integer_part [ . fractional_part ]
or
integer_part [ . fractional_part ] suffix

Parts

prefix
One of these symbols: at-symbol (@) or currency symbol (¤). You can optionally follow the at-symbol with the currency symbol of a given culture. Examples include $, , £, 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 18 decimal digits. For the default number of decimal digits, the maximum is 15 digits. You can use an underscore (_) to divide it into groups of digits.
fractional_part
One to 18 decimal digits. For the default number of decimal digits, the maximum is 4 digits. All digits after that are ignored.
suffix
One of these: the at-symbol (@) or the type suffix d64. You can also write the type suffix as D64.

Constructors

Fixed64(Optional digits As Int32 = 4)
digits specifies the number of digits to the right of the decimal point. It must be between 1 and 19. The default is 4.

Shared methods and properties

Fixed64.Default As Fixed64
Returns the default value, ¤0.0.
Fixed64.Epsilon(Optional x As Fixed64) As Fixed64
Returns the smallest value more than ¤0.0. If x is not given, it returns ¤0.0001
Fixed64.Max(Optional x As Fixed64) As Fixed64
Returns the largest positive value for x. If x is not given, it returns ¤922_337_203_685_477.5807
Fixed64.Min(Optional x As Fixed64) As Fixed64
Returns the smallest negative value for x. If x is not given, it returns −¤922_337_203_685_477.5808
Fixed64.Parse(str As String, Optional #format As Format) As Fixed64
Tries to parse a string that shows as a number.
If #format is not given or is #Null, it uses the format of the local culture. Or you can make it clear with Format.UserLocale.
Fixed64.Size As Int32
Returns the number of available bytes. This is always 8.

Examples

Dim price As Fixed64 = @$1_199.99
Dim price@ = @$1_199.99

See also