aboutsummaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
authorSatoshi Nakamoto <satoshin@gmx.com>2010-08-12 13:20:57 +0000
committerGavin Andresen <gavinandresen@gmail.com>2010-08-12 13:20:57 +0000
commit410b618d18d712db680de8f173a671bb637ff2b0 (patch)
tree49c5a9f4768b750715fedd62194bc41d4fda0865 /json
parentc2fa70ddfd7711d514a701b3a7c8adb561acc3ff (diff)
downloadbitcoin-410b618d18d712db680de8f173a671bb637ff2b0.tar.xz
json-spirit print reals with 8 decimal places,
bitcoind help <command> instead of bitcoind <command> -?
Diffstat (limited to 'json')
-rw-r--r--json/json_spirit_value.h2
-rw-r--r--json/json_spirit_writer_template.h5
2 files changed, 5 insertions, 2 deletions
diff --git a/json/json_spirit_value.h b/json/json_spirit_value.h
index 6274df1095..7e83a2a7e3 100644
--- a/json/json_spirit_value.h
+++ b/json/json_spirit_value.h
@@ -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() );
diff --git a/json/json_spirit_writer_template.h b/json/json_spirit_writer_template.h
index 33bd0ff867..28c49ddc64 100644
--- a/json/json_spirit_writer_template.h
+++ b/json/json_spirit_writer_template.h
@@ -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 );
}