Guest User

Untitled

a guest
Jul 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. MonetaryAmountFormat germanyFormat = MonetaryFormats.getAmountFormat(Locale.GERMANY);
  2. System.out.println(germanyFormat.format(Money.of(123.50, "EUR")));
  3. //Output: 123,50 EUR
  4.  
  5. MonetaryAmountFormat italyFormat = MonetaryFormats.getAmountFormat(Locale.ITALY);
  6. System.out.println(italyFormat.format(Money.of(123.50, "EUR")));
  7. //Output: EUR 123,50
  8.  
  9. MonetaryAmountFormat brazilFormat = MonetaryFormats.getAmountFormat(new Locale("pt", "BR"));
  10. System.out.println(brazilFormat.format(Money.of(123.50, "BRL")));
  11. //Output: BRL 123,50
  12.  
  13. MonetaryAmountFormat usFormat = MonetaryFormats.getAmountFormat(Locale.US);
  14. System.out.println(usFormat.format(Money.of(123.50, "USD")));
  15. //Output: USD123.50
Add Comment
Please, Sign In to add comment