# JSONEncoder / Encodable: Floating point rounding error

**URL:** <https://forums.swift.org/t/jsonencoder-encodable-floating-point-rounding-error/41390>\
**Category:** Using Swift\
**Tags:** codable\
**Created:** [October 23, 2020, 4:44am UTC](https://forums.swift.org/t/jsonencoder-encodable-floating-point-rounding-error/41390 "2020-10-23T04:44:18Z")\
**Posts on this page:** 1\
**Showing post:** 39

<div class="post-metadata">

**Author:** ![reuschj](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/reuschj/32/6868_2.png) [@reuschj](https://forums.swift.org/u/reuschj)\
**Post date:** [October 25, 2020, 5:52am UTC](https://forums.swift.org/t/jsonencoder-encodable-floating-point-rounding-error/41390/39 "2020-10-25T05:52:07Z")

</div>

> [@pyrtsa](#):
>
> Nowadays it's only the closed Foundation implementation on Apple platforms where the JSON encoding could do better

This is a good example of a gripe I have with how entangled the Swift toolchain is with Xcode, etc. on Macs, as discussed on [this thread](https://forums.swift.org/t/a-few-take-aways-from-the-rust-ecosystem/40771/12). IMO, it would be better if the Swift toolchain for Macs looked a lot more like the one for Linux (no Xcode/Apple platform development stuff... all that could be an "extension" added on by Xcode). 🤷‍♂️

---

_[View the full topic](https://forums.swift.org/t/jsonencoder-encodable-floating-point-rounding-error/41390)._
