MCPcopy Create free account
hub / github.com/ZL-Audio/ZLEqualizer / fixFormatFloat

Function fixFormatFloat

source/gui/interface_definitions.hpp:168–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 }
167
168 inline std::string fixFormatFloat(const float x, const int length) {
169 auto y = std::abs(x);
170 if (y < 10) {
171 return formatFloat(x, length - 1);
172 } else if (y < 100) {
173 return formatFloat(x, length - 2);
174 } else if (y < 1000) {
175 return formatFloat(x, length - 3);
176 } else if (y < 10000) {
177 return formatFloat(x, length - 4);
178 } else {
179 return formatFloat(x, length - 5);
180 }
181 }
182
183 class UIBase {
184 public:

Callers

nothing calls this directly

Calls 1

formatFloatFunction · 0.85

Tested by

no test coverage detected