Amount

data class Amount(val amount: BigDecimal, val currency: String)

Monetary amount paired with an ISO 4217 currency code.

Constructors

Link copied to clipboard
constructor(amount: BigDecimal, currency: String)
constructor(amount: String, currency: String)

Convenience constructor that parses amount as a decimal, preserving the original number of fractional digits (e.g. Amount("100.00", "EUR") keeps the two trailing zeros). Accepts whatever BigDecimal.parseString accepts; non-canonical inputs are normalized on the wire. Callers needing byte-exact control should construct a BigDecimal themselves and use the primary constructor.

Properties

Link copied to clipboard

Exact decimal amount; serialized as a JSON string to preserve scale.

Link copied to clipboard

ISO 4217 Alpha 3 currency code.