From: Sami Kerola Date: Tue, 16 Aug 2016 09:06:46 +0000 (+0100) Subject: cast: do not downgrade to float when double should be used X-Git-Tag: v0.88~38^2^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b700bb583497c4c64417cb6896344076812e25f2;p=thirdparty%2Fmtr.git cast: do not downgrade to float when double should be used Regression from commit 78f019aa9d49be5ada89296a462939738c20c181 Requested-by: rewolff Reference: https://github.com/traviscross/mtr/pull/135/files#r74889063 --- diff --git a/report.c b/report.c index 02ea6cb..cbea49b 100644 --- a/report.c +++ b/report.c @@ -472,7 +472,7 @@ void csv_close(time_t now) /* 1000.0 is a temporay hack for stats usec to ms, impacted net_loss. */ if( strchr( data_fields[j].format, 'f' ) ) { - printf( ",%.2f", (float) (data_fields[j].net_xxx(at) / 1000.0)); + printf( ",%.2f", (double) (data_fields[j].net_xxx(at) / 1000.0)); } else { printf( ",%d", data_fields[j].net_xxx(at) ); }