Flutter/Dart number handling ability

Viewed 4372

I an kind of new in Flutter. I want to make a calculator with a large input. considering 30/40 digit each number. Can anybody help me with how I can do so? Like in android I used "BigDecimal" what is the alternative of that in Flutter?

1 Answers

You can use the decimal package.

// with double
print(0.2 + 0.1); // displays 0.30000000000000004

// with decimal
print(Decimal.parse('0.2') + Decimal.parse('0.1')); // displays 0.3
Related