aboutsummaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-08-10 19:21:17 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-08-10 19:21:17 +0000
commit342e1b73385cac5a5b2fc7316d82a2b55b3a85d4 (patch)
tree779fde91134f080040a38214ce53fc75c01f1360 /json
parent94cfec07fd302c9ff9b6a80c47418d4fe56596ae (diff)
downloadbitcoin-342e1b73385cac5a5b2fc7316d82a2b55b3a85d4.tar.xz
json-spirit print reals with 8 decimal places,
bitcoind help <command> instead of bitcoind <command> -? git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@126 1a98c847-1fd6-4fd8-948a-caf3550aa51b
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 e9bcd36b80..05747faac3 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 c993756555..90d2ae69d2 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 );
}