MCPcopy Create free account
hub / github.com/arrayfire/forge / getDigitCount

Function getDigitCount

src/backend/opengl/chart_impl.cpp:372–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372int getDigitCount(float value)
373{
374 int count = 0;
375
376 float v = std::abs(value);
377
378 if (v<1.0f) {
379 if (v>FLT_EPSILON) {
380 while(v<1) {
381 v = v * 10.0f;
382 count++;
383 }
384 }
385 } else {
386 int num = int(value);
387 while (num) {
388 num = num/10;
389 count++;
390 }
391 }
392
393 return count;
394}
395
396void chart2d_impl::generateTickLabels()
397{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected