I have an instance of javax.money.CurrencyUnit and I want to display what is it's name in a given locale (for example "US Dollars", "Euro", "Japenese Yen", etc). I've read all the documentation but the only thing I was able to find is how to format a MonetaryAmount:
MonetaryFormats.getAmountFormat(AmountFormatQueryBuilder.of(Locale.US).set(CurrencyStyle.NAME).set("pattern", "00,00,00,00.00 ¤").build()).format(myCurrencyUnit);
And I can see there I specify CurrencyStyle.NAME so it will return the currency name in the result, but the problem is I don't have a MonetaryAmount and I couldn't find a formatter for CurrencyUnit.
Thank you
What I see from code is that JavaMoney doesn't support such concept as Currency Display Name. The
CurrencyStyle.NAMEtries to resolve Display Name from JDK Currency.Thus you can't get display name for custom currencies like BitCoins. It was created a feature request Get display name/symbol of a CurrencyUnit