I need to parse a String with 18 decimal values to double, but it seems double only support 14 decimal values.
For example: “15.123456789101112131”
Precise(
String value,
{int sigDigits = 50}
)
Constructs an arbitrary precision number from a string.
The precision can be limited by providing the maximum number of significant digits (default is 50).
Examples: Precise('12') Precise('0.1234') Precise('15.123456789101112131') Precise('1.23456789e-6', sigDigits: 4)
doubletype is a binary floating-point type, so storing a specific number of decimal digits is a bit nonsensical. If you want to store a specific number of decimal digits, use a type appropriate for that, such as thePreciseclass mentioned above orpackage:decimal.