[swift-users] Parsing Decimal values from JSON

Evtim Papushev e.papushev at me.com
Sat Oct 28 13:23:00 CDT 2017


Hello :)

I am trying to find a way to parse a number as Decimal without losing the number's precision.

It seems that the JSON decoder parses it as Double then converts it to Decimal which introduces errors in the parsing. That behavior is in fact incorrect.

Does anyone know if there is a way to obtain the raw data for this specific field so I can write the conversion code?

Thanks,
Evtim



More information about the swift-users mailing list