aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/unstable/json.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/unstable/json.cpp b/src/unstable/json.cpp
index 9745a7f..65bd195 100644
--- a/src/unstable/json.cpp
+++ b/src/unstable/json.cpp
@@ -429,7 +429,14 @@ void Bu::Json::write( Bu::Stream &sOutput ) const
429 case Number: 429 case Number:
430 { 430 {
431 char buf[64]; 431 char buf[64];
432 sprintf( buf, "%f", uDat.dNumber ); 432 if( uDat.dNumber == floor( uDat.dNumber ) )
433 {
434 sprintf( buf, "%ld", (int64_t)uDat.dNumber );
435 }
436 else
437 {
438 sprintf( buf, "%f", uDat.dNumber );
439 }
433 sOutput.write( buf ); 440 sOutput.write( buf );
434 } 441 }
435 break; 442 break;