dart-decimal
dart-decimal copied to clipboard
Implement isNegative property
When calling NumberFormat.format() with Decimal as an argument, there is
NoSuchMethodError
Class 'Decimal' has no instance getter 'isNegative'.
Receiver: Instance of 'Decimal'
Tried calling: isNegative
It would be great to have isNegative property (getter) added as other num do have it :)
Do you have a particular value of decimal to reproduce this error?
final decimal = Decimal.fromInt(1000);
final formatter = NumberFormat(
"0.0##",
"en_US",
);
formatter.format(decimal);
I guess something like this causes the error but the formatter should be called like this
formatter.format(DeicmalIntl(decimal));