Am 27.04.2012 22:21, schrieb Michael Roth: > Currently string-output-visitor formats floats as %g, which is nice in > that trailing 0's are automatically truncated, but otherwise this causes > some issues: > > - it 6 uses significant figures instead of 6 decimal places, which
"it uses 6 significant" > means something like 155777.5 (which even has an exact floating point > representation) will be rounded to 155778 when converted to a string. > > - output will be presented in scientific notation when the normalized > form requires a 10^x multiplier. Not a huge deal, but arguably less > readable for command-line arguments. > > - due to using sig figs instead of hard-defined decimal places, it "six figs"? > fails a lot of the test-visitor-serialization unit tests for floats. > > Instead, let's just use %f, which is what the QJSON and the QMP visitors > use. > > Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com> /-F -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg