diff options
author | Mike Buland <mbuland@penny-arcade.com> | 2019-07-08 10:43:57 -0700 |
---|---|---|
committer | Mike Buland <mbuland@penny-arcade.com> | 2019-07-08 10:43:57 -0700 |
commit | 76649ebc55a243882ba6ac981f41c1d007b6f63a (patch) | |
tree | fa94991862a853bd1111c8cc9a6adac4868b49e5 /src/unstable | |
parent | 9cdf227b84a18141de527a0ad85344a20914b974 (diff) | |
download | libbu++-76649ebc55a243882ba6ac981f41c1d007b6f63a.tar.gz libbu++-76649ebc55a243882ba6ac981f41c1d007b6f63a.tar.bz2 libbu++-76649ebc55a243882ba6ac981f41c1d007b6f63a.tar.xz libbu++-76649ebc55a243882ba6ac981f41c1d007b6f63a.zip |
Fixed number formatting bug by using libc sprintf.
Diffstat (limited to '')
-rw-r--r-- | src/unstable/json.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/unstable/json.cpp b/src/unstable/json.cpp index d3d8535..f6a8d52 100644 --- a/src/unstable/json.cpp +++ b/src/unstable/json.cpp | |||
@@ -424,7 +424,11 @@ void Bu::Json::write( Bu::Stream &sOutput ) const | |||
424 | break; | 424 | break; |
425 | 425 | ||
426 | case Number: | 426 | case Number: |
427 | sOutput.write(Bu::String("%1").arg( uDat.dNumber )); | 427 | { |
428 | char buf[64]; | ||
429 | sprintf( buf, "%f", uDat.dNumber ); | ||
430 | sOutput.write( buf ); | ||
431 | } | ||
428 | break; | 432 | break; |
429 | 433 | ||
430 | case Boolean: | 434 | case Boolean: |