spring-framework / org.springframework.format.number.money / MonetaryAmountFormatter

MonetaryAmountFormatter

open class MonetaryAmountFormatter : Formatter<MonetaryAmount>

Formatter for JSR-354 javax.money.MonetaryAmount values, delegating to javax.money.format.MonetaryAmountFormat#format and javax.money.format.MonetaryAmountFormat#parse.

Author
Juergen Hoeller

Since
4.2

See Also
#getMonetaryAmountFormat

Constructors

<init>

MonetaryAmountFormatter()

Create a locale-driven MonetaryAmountFormatter.

MonetaryAmountFormatter(formatName: String)

Create a new MonetaryAmountFormatter for the given format name.

Functions

parse

open fun parse(text: String, locale: Locale): MonetaryAmount

print

open fun print(object: MonetaryAmount, locale: Locale): String

setFormatName

open fun setFormatName(formatName: String): Unit

Specify the format name, to be resolved by the JSR-354 provider at runtime.

Default is none, obtaining a MonetaryAmountFormat based on the current locale.