From 36422d2f9ee1856bec35892338845af85034190b Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 1 Mar 2013 07:16:59 -0800 Subject: 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 Signed-off-by: Dirk Hohndel --- save-xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/save-xml.c b/save-xml.c index 0685c9fd1..a23fb10a3 100644 --- a/save-xml.c +++ b/save-xml.c @@ -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"); -- cgit v1.2.3-70-g09d2