Correct negative amount display
This commit is contained in:
parent
6f045918d9
commit
251b7ad1d0
|
|
@ -196,13 +196,14 @@ String formatNumber(
|
||||||
formatted = formatter.format(value < 0 ? value * -1 : value);
|
formatted = formatter.format(value < 0 ? value * -1 : value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final prefix = value < 0 ? '-' : '';
|
||||||
|
|
||||||
if (formatNumberType == FormatNumberType.percent) {
|
if (formatNumberType == FormatNumberType.percent) {
|
||||||
return '$formatted%';
|
return '$formatted%';
|
||||||
} else if ((showCurrencyCode ?? company.settings.showCurrencyCode ?? false) ||
|
} else if ((showCurrencyCode ?? company.settings.showCurrencyCode ?? false) ||
|
||||||
currency.symbol.isEmpty) {
|
currency.symbol.isEmpty) {
|
||||||
return '$formatted ${currency.code}';
|
return '$prefix$formatted ${currency.code}';
|
||||||
} else {
|
} else {
|
||||||
final prefix = value < 0 ? '-' : '';
|
|
||||||
if (swapCurrencySymbol) {
|
if (swapCurrencySymbol) {
|
||||||
return '$prefix$formatted ${currency.symbol.trim()}';
|
return '$prefix$formatted ${currency.symbol.trim()}';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue