I know how to print a joda-money object using the MoneyFormatterBuilder
:
Money m = Money.of(CurrencyUnit.USD, 48209);
System.out.println(new MoneyFormatterBuilder().appendAmount(MoneyAmountStyle.ASCII_DECIMAL_POINT_GROUP3_COMMA).toFormatter().print(m));
But this prints it with decimals:
48,209.00
How do I print a joda-money object with no decimals? And have it round up if necessary? So that the output of the above would be:
48,209
And (another example) 48209.69
would print 48210
?
You can rounding money and then get string value out of it and replace decimal places.