This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 35
MoneyDecodingOptions
mattt edited this page Oct 30, 2020
·
5 revisions
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
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.
Throws an error when attempting to decode
amount
from a floating-point number.
let requireStringAmount
Rounds amount
to the number of places of the minor currency unit
when decoding from a floating-point number.
let roundFloatingPointAmount
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