diff options
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); +} |