mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Fixed double number JSON serialization to encode 17 significant digits (this
matches the max number of significant digits in the double-precision floating point format). This prevents a loss of precision, in case the number has more than 3 digits after the decimal point. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37556 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1050967fe5
commit
16fc05ced5
3 changed files with 13 additions and 2 deletions
|
@ -901,7 +901,7 @@ writeObject(id obj, NSMutableString *output, NSInteger tabs)
|
|||
}
|
||||
else
|
||||
{
|
||||
[output appendFormat: @"%g", [(NSNumber*)obj doubleValue]];
|
||||
[output appendFormat: @"%.17g", [(NSNumber*)obj doubleValue]];
|
||||
}
|
||||
}
|
||||
else if ([obj isKindOfClass: NSNullClass])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue