asBinary

asBinary(): Binary;

The asBinary method of the Decimal primitive type returns the Binary representation of the receiver.

In situations where the compatibility with earlier releases is required, you should use this method in preference to casting the Decimal value to a Binary value (that is, Decimal.Binary).

Casting a Decimal value to a Binary returns the binary representation of the internal representation of the decimal. This depends on the implementation, which is subject to change.

dec := bin.asDecimal;    // Prefer this to "dec := bin.Decimal;"

To convert the resulting binary value back to a decimal value, use the asDecimal method of the Binary primitive type.