Skip to content

Configuration of currency style without dependency on an implementation #83

@vb-chris

Description

@vb-chris

I'm trying to create a MonetaryAmountFormat that uses the currency unit symbol:

MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(
  AmountFormatQueryBuilder.of(Locale.GERMANY)
                          .set(org.javamoney.moneta.format.CurrencyStyle.SYMBOL)
                          .set("pattern", "#,##0.##¤")
                          .build()
);

The java/maven project has a dependency on moneta in runtime (not compile-time) scope. It seems that the class CurrencyStyle and its value SYMBOL are part of moneta, the java-money reference implementation, and not part of the java-money API. Thus, the code does not compile.

I'd prefer to create a MonetaryAmountFormat that uses the currency unit symbol without a compile-time dependency on an implementation.

(previously asked on Stack Overflow)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions