Decimal128Value constructor

Decimal128Value(
  1. String stringValue
)

Creates a 128-bit decimal from its string representation, for example 1.5, -1.2e3, NaN, Infinity or -Infinity.

The value must be one that IEEE 754 decimal128 holds exactly, as the backend only stores such values: at most 34 significant digits (leading zeros, and trailing zeros that do not carry a digit, do not count, so 1. with 40 zeros is fine), and nothing above 9.99...9e6144 (34 nines) or below 1e-6176 in the last digit. Zeros of any exponent, NaN and the infinities are fine.

Throws a FormatException if stringValue is not a decimal number, or one that decimal128 can not hold exactly (for example 1.0000000000000000000000000000000001, 1e6145 or 1e-6177).

Implementation

Decimal128Value(this.stringValue) : _number = _parse(stringValue);