Fix time label print in gmx vanhove
authorBerk Hess <hess@kth.se>
Tue, 1 Nov 2016 11:05:07 +0000 (12:05 +0100)
committerBerk Hess <hess@kth.se>
Tue, 1 Nov 2016 11:05:07 +0000 (12:05 +0100)
Change-Id: Ibf668e46622c2739ae44f950d1bbfadbbb67b276

src/gromacs/gmxana/gmx_vanhove.cpp

index db3da07cff5eeb9089dbcedaf2d5d5407d39e1ce..0c660cc4b359639c1366d26a0101d917b5321634 100644 (file)
@@ -229,7 +229,7 @@ int gmx_vanhove(int argc, char *argv[])
 
     dt = (time[nfr-1] - time[0])/(nfr - 1);
     /* Some ugly rounding to get nice nice times in the output */
-    dt = static_cast<int>((10000.0*dt + 0.5)/10000.0);
+    dt = std::round(10000.0*dt)/10000.0;
 
     invbin = 1.0/rbin;