From 1a71fd8efa0350d1e121f6792e8fad67e82b25c1 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 5 Apr 2018 13:20:20 +0200 Subject: fixed name conflict, now builds in MSVC --- src/util.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/util.cpp') diff --git a/src/util.cpp b/src/util.cpp index 64716d2..5e56cd9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -46,3 +46,9 @@ float normaliseAngleRad (float rads) { } return rads; } + +// convert float to string, squashing very small floats to zero +QString floatToString(float f) { + if (f >= -0.000001 && f <= 0.000001) return "0"; + else return QString::number(f); +} -- cgit v1.2.3