[swift-users] Parsing Decimal values from JSON

Kevin Lundberg kevin at klundberg.com
Mon Oct 30 20:27:38 CDT 2017


Swift shouldn't be forced to adhere to the limitations of JavaScript.
Just because JS doesn't know about decimals doesn't mean swift can't do
better.

Evtim, I don't believe JSONDecoder provides the access you are looking
for. Have you filed a bug on bugs.swift.org?

On 10/30/2017 6:02 AM, Rimantas Liubertas via swift-users wrote:
>
>     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.
>
>
> Why do you say that? JS in JSON stand for JavaScript, and Javascript
> has now idea about neither Decimal nor Integer numbers.
>
>
> Best regards,
> Rimantas
>
>
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171030/a03deec1/attachment.html>


More information about the swift-users mailing list