I'd like to format negative amounts with minus sign before currency symbol, i. e:
Given input value: -123.45
I want the output to be: -$123.45
.
Is there any way to acomplish it with Joda Money?
Here's what I tried:
Money money = Money.of(CurrencyUnit.USD, -123.45);
MoneyFormatter formatter = new MoneyFormatterBuilder()
.appendCurrencySymbolLocalized()
.appendAmountLocalized()
.toFormatter(Locale.US);
String formatted = formatter.print(money);
But that gives me: $-123.45