← Back to Kairo Docs|API Reference (Dokka)

Package-level declarations

Types

Link copied to clipboard
class CurrencyUnitDeserializer : StdDeserializer<CurrencyUnit>
Link copied to clipboard
class CurrencyUnitSerializer : StdSerializer<CurrencyUnit>
Link copied to clipboard
abstract class MoneyFormat

Controls how Money is serialized to and deserialized from JSON. Extend this class to define a custom wire format for monetary values.

Link copied to clipboard
class MoneyModule : SimpleModule

Jackson module that registers serializers/deserializers for Money and CurrencyUnit. Must be registered on every ObjectMapper that handles monetary values.

Functions

Link copied to clipboard
Link copied to clipboard
inline fun <T : Number> NumberValue.numberValueExact(): T

Reified wrapper for NumberValue.numberValueExact that avoids the precision loss you'd get from NumberValue.doubleValue or NumberValue.longValue.

Link copied to clipboard
fun Money.round(): Money

Rounds using javax.money's default rounding, which is HALF_UP to the currency's standard decimal places (e.g. 2 for USD, 0 for JPY). The rounding behavior varies depending on the currency.