From 156ce25ce08fe67556e812f9361bf4ad57b860c5 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 29 Dec 2011 23:40:06 +0000 Subject: Fixed a bug in the formatter, it was displaying numbers with trailing zeros without the trailing zeros. --- src/formatter.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/formatter.h b/src/formatter.h index 80a55ab..a440ec3 100644 --- a/src/formatter.h +++ b/src/formatter.h @@ -159,7 +159,8 @@ namespace Bu int c = f; fTmp += (char)((c<10)?('0'+c):(cBase+c-10)); f -= (int)f; - for( int j = 0; j < 8 && f; j++ ) + int j; + for( j = 0; j < 8 && f; j++ ) { if( iScale - j == 0 ) fTmp += '.'; @@ -168,6 +169,12 @@ namespace Bu fTmp += (char)((c<10)?('0'+c):(cBase+c-10)); f -= (int)f; } + if( iScale >= j ) + { + for( int k = j; k < iScale; k++ ) + fTmp += '0'; + fTmp += ".0"; + } writeAligned( fTmp ); usedFormat(); -- cgit v1.2.3