Fix saving of po2 values

It was very broken, although it just happened to work for the values
dirk had in his own XML file (0 and 0.800 bar).  Because of confusion
with number of digits it would save 1.080 bar as 1.80 bar.

Use our "show_milli()" helper for showing things that are in milli-units
(which is what we tend to use for most of our values: mK, mbar, mm, ml)

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2013-03-01 07:16:59 -08:00 committed by Dirk Hohndel
parent c3b3ab9af7
commit 36422d2f9e

View file

@ -366,7 +366,7 @@ static void save_sample(FILE *f, struct sample *sample, struct sample *old)
}
if (sample->po2 != old->po2) {
fprintf(f, " po2='%u.%2u bar'", FRACTION(sample->po2, 1000));
show_milli(f, " po2='", sample->po2, " bar", "'");
old->po2 = sample->po2;
}
fprintf(f, " />\n");