json-spirit print reals with 8 decimal places,

bitcoind help <command> instead of bitcoind <command> -?
This commit is contained in:
Satoshi Nakamoto
2010-08-12 13:20:57 +00:00
committed by Gavin Andresen
parent c2fa70ddfd
commit 410b618d18
4 changed files with 46 additions and 54 deletions

View File

@@ -342,7 +342,7 @@ namespace json_spirit
{
std::ostringstream os;
/// satoshi: tell the types by name instead of by number
///// Bitcoin: Tell the types by name instead of by number
os << "value is type " << Value_type_name[type()] << ", expected " << Value_type_name[vtype];
throw std::runtime_error( os.str() );

View File

@@ -124,8 +124,11 @@ namespace json_spirit
case str_type: output( value.get_str() ); break;
case bool_type: output( value.get_bool() ); break;
case int_type: output_int( value ); break;
case real_type: os_ << std::showpoint << std::setprecision( 16 )
/// Bitcoin: Added std::fixed and changed precision from 16 to 8
case real_type: os_ << std::showpoint << std::fixed << std::setprecision(8)
<< value.get_real(); break;
case null_type: os_ << "null"; break;
default: assert( false );
}