diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2018-04-05 13:20:20 +0200 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2018-04-05 13:20:20 +0200 |
commit | 1a71fd8efa0350d1e121f6792e8fad67e82b25c1 (patch) | |
tree | 0e706cf35256c5195974105218ad2b6ea49e1193 /src/util.cpp | |
parent | 8b8ea9395bdda4bb1404497ff654b82098084822 (diff) |
fixed name conflict, now builds in MSVC
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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); +} |