From 63f1be8f2cda0ba00af81ad14e0369ee675088f4 Mon Sep 17 00:00:00 2001 From: Curtis Merrill Date: Sun, 29 Dec 2019 21:21:17 -0500 Subject: [PATCH] fix units::serialize (#36546) --- src/units.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/units.cpp b/src/units.cpp index a2122749dded9..de19b3665ba15 100644 --- a/src/units.cpp +++ b/src/units.cpp @@ -7,7 +7,7 @@ template<> void volume::serialize( JsonOut &jsout ) const { if( value_ % 1000 == 0 ) { - jsout.write( string_format( "%d L", value_ ) ); + jsout.write( string_format( "%d L", value_ / 1000 ) ); } else { jsout.write( string_format( "%d ml", value_ ) ); } @@ -17,9 +17,9 @@ template<> void mass::serialize( JsonOut &jsout ) const { if( value_ % 1000000 == 0 ) { - jsout.write( string_format( "%d kg", value_ ) ); + jsout.write( string_format( "%d kg", value_ / 1000000 ) ); } else if( value_ % 1000 == 0 ) { - jsout.write( string_format( "%d g", value_ ) ); + jsout.write( string_format( "%d g", value_ / 1000 ) ); } else { jsout.write( string_format( "%d mg", value_ ) ); }