tristanhimmelman / ObjectMapper

Simple JSON Object mapping written in Swift
MIT License
9.14k stars 1.03k forks source link

Incorrect double value when creating JSON string #1083

Open avjiang opened 4 years ago

avjiang commented 4 years ago

I have property

public var margin: Double = 0.00

It seems the library will output wrong value whenever there is double value starts from 0.++ . In my case the value is 0.1. When output to JSON string, it becomes 0.100000000001

Is there something that I am missing? Thank you