src/Utils.cpp

changeset 29
76846c99f827
parent 20
fcbbddcc22c1
child 42
88e827ea7172
--- a/src/Utils.cpp	Fri Feb 25 10:51:36 2022 +0100
+++ b/src/Utils.cpp	Sat Feb 26 16:34:20 2022 +0100
@@ -18,14 +18,6 @@
 
 #include <math.h>
 
-double Utils::Round(double n, int d)
-{
-    int m;
-
-    for (int i = 0, m = 1; i < d; i++, m *= 10);
-    return round(n * m) / m;
-}
-
 
 double Utils::lintner_to_kolbach(double lintner)
 {
@@ -38,6 +30,6 @@
 
 double Utils::kolbach_to_lintner(double kolbach)
 {
-    return Round((kolbach + 16) / 3.5, 3);
+    return round(((kolbach + 16) / 3.5) * 1000.0) / 1000.0;
 }
 

mercurial