-
-
Notifications
You must be signed in to change notification settings - Fork 35
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.
OptionSet
public init(rawValue: Int)
let rawValue: Int
Allows Money
values to be decoded from string and number values,
in addition to keyed containers,
using the associated Currency
type.
let allowSingleValues
Throws an error when attempting to decode
amount
from a floating-point number.
let requireStringAmounts
Important: Foundation decoders currently decode number values using binary floating-point number type, which cannot precisely express certain values. Monetary amounts can, however, be precisely decoded from string values.
Bug: See https://bugs.swift.org/browse/SR-7054.
Rounds amount
to the number of places of the minor currency unit
when decoding from a floating-point number.
let roundFloatingPointAmounts
Generated at 2020-10-30T17:09:26+0000 using swift-doc 1.0.0-beta.5.
Types
- AED
- AFN
- ALL
- AMD
- ANG
- AOA
- ARS
- AUD
- AWG
- AZN
- BAM
- BBD
- BDT
- BGN
- BHD
- BIF
- BMD
- BND
- BOB
- BOV
- BRL
- BSD
- BTN
- BWP
- BYN
- BZD
- CAD
- CDF
- CHE
- CHF
- CHW
- CLF
- CLP
- CNY
- COP
- COU
- CRC
- CUC
- CUP
- CVE
- CZK
- DJF
- DKK
- DOP
- DZD
- EGP
- ERN
- ETB
- EUR
- FJD
- FKP
- GBP
- GEL
- GHS
- GIP
- GMD
- GNF
- GTQ
- GYD
- HKD
- HNL
- HRK
- HTG
- HUF
- IDR
- ILS
- INR
- IQD
- IRR
- ISK
- JMD
- JOD
- JPY
- KES
- KGS
- KHR
- KMF
- KPW
- KRW
- KWD
- KYD
- KZT
- LAK
- LBP
- LKR
- LRD
- LSL
- LYD
- MAD
- MDL
- MGA
- MKD
- MMK
- MNT
- MOP
- MRU
- MUR
- MVR
- MWK
- MXN
- MXV
- MYR
- MZN
- Money
- MoneyDecodingOptions
- MoneyEncodingOptions
- NAD
- NGN
- NIO
- NOK
- NPR
- NZD
- OMR
- PAB
- PEN
- PGK
- PHP
- PKR
- PLN
- PYG
- QAR
- RON
- RSD
- RUB
- RWF
- SAR
- SBD
- SCR
- SDG
- SEK
- SGD
- SHP
- SLL
- SOS
- SRD
- SSP
- STN
- SVC
- SYP
- SZL
- THB
- TJS
- TMT
- TND
- TOP
- TRY
- TTD
- TWD
- TZS
- UAH
- UGX
- USD
- UYI
- UYU
- UZS
- VEF
- VND
- VUV
- WST
- XCD
- YER
- ZAR
- ZMW
- ZWL