-
Notifications
You must be signed in to change notification settings - Fork 92
See the code examples
Julia Glaszka edited this page Jul 11, 2023
·
2 revisions
ValueConverters intConverter = ValueConverters.ENGLISH_INTEGER;
String valueAsWords = intConverter.asWords(1_234);
assertEquals("one thousand two hundred thirty-four", valueAsWords);
LongValueConverters longConverter = LongValueConverters.ENGLISH_LONG;
String valueAsWords = converter.asWords(1_000_000_000_000_000_000);
assertEquals("one quintillion", valueAsWords);
MoneyConverters converter = MoneyConverters.ENGLISH_BANKING_MONEY_VALUE;
String moneyAsWords = converter.asWords(new BigDecimal("1234.56"));
assertEquals("one thousand two hundred thirty-four £ 56/100", moneyAsWords);
MoneyConverters converter = MoneyConverters.ENGLISH_BANKING_MONEY_VALUE;
String moneyAsWordsWithCurrency = converter.asWords(new BigDecimal("1234.56", "EUR"));
assertEquals("one thousand two hundred thirty-four EUR 56/100", moneyAsWordsWithCurrency);