Closed
Description
Previous ID | SR-2151 |
Radar | None |
Original Reporter | abinner (JIRA User) |
Type | Bug |
Status | Resolved |
Resolution | Done |
Environment
Swift version 3.0 (swift-3.0-PREVIEW-2)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
Votes | 0 |
Component/s | Foundation |
Labels | Bug |
Assignee | DavidYangLiu (JIRA) |
Priority | Medium |
md5: b9078e1e9b7a2c5c536f4a7d304e2f37
Issue Description:
When serializing Double values smaller than 1.0 and bigger than -1.0, the current implementation omits the leading "0". This is not allowed according to json.org and in fact the produced JSON code can't be parsed by the iOS/macOS implementation of NSJSONSerialization
!
Example
Incorrect
{
"foo": .1234
}
Should be
{
"foo": 0.1234
}