Skip to content

MoneyDecodingOptions

mattt edited this page Oct 30, 2020 · 5 revisions

MoneyDecodingOptions

Custom decoding options for Money values.

public struct MoneyDecodingOptions: OptionSet

Configure the decoding behavior either by using the JSONDecoder.moneyDecodingOptions property or by setting the CodingUserInfoKey.moneyDecodingOptions key in the decoder's userInfo property.

Inheritance

OptionSet

Initializers

init(rawValue:)

public init(rawValue: Int)

Properties

rawValue

let rawValue: Int

requireExplicitCurrency

Throws a DecodingError when attempting to decode a Money value from a string or number value.

let requireExplicitCurrency

By default, Money values are decoded from single values using the associated Currency type.

requireStringAmount

Throws an error when attempting to decode amount from a floating-point number.

let requireStringAmount

roundFloatingPointAmount

Rounds amount to the number of places of the minor currency unit when decoding from a floating-point number.

let roundFloatingPointAmount
Clone this wiki locally