You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.
Consider the following JSON with three double values: [0.608, 0.0608, 0.00608]. When parsed with Jay, the resulting array contains 0.608 three times, so the scale is completely lost.
In other words:
import Jay
lettestData=Array("[0.608, 0.0608, 0.00608]".utf8)letjay=Jay()letjson=try jay.anyJsonFromData(testData)print(json)// [0.60799999999999998, 0.60799999999999998, 0.60799999999999998]
After some investigation, the culprit is NumberParser.swift:202, where the collected fractional digits are naively converted to an integer. For example when parsing the third number, the digs array ["0", "0", "6", "0", "8"] becomes 608, losing the two initial zeroes.
The text was updated successfully, but these errors were encountered:
Consider the following JSON with three double values:
[0.608, 0.0608, 0.00608]
. When parsed with Jay, the resulting array contains0.608
three times, so the scale is completely lost.In other words:
After some investigation, the culprit is NumberParser.swift:202, where the collected fractional digits are naively converted to an integer. For example when parsing the third number, the
digs
array["0", "0", "6", "0", "8"]
becomes608
, losing the two initial zeroes.The text was updated successfully, but these errors were encountered: