MCPcopy Create free account
hub / github.com/Tom94/tev / formatNumber

Function formatNumber

src/MultiGraph.cpp:35–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace tev {
34
35static string formatNumber(float v) {
36 bool needsScientificNotation = v != 0 && (abs(v) < 0.01f || abs(v) >= 1000);
37 return needsScientificNotation ? fmt::format("{:.2e}", v) : fmt::format("{:.3f}", v);
38}
39
40MultiGraph::MultiGraph(Widget* parent, string_view caption) : Widget{parent}, mCaption{caption} {
41 mBackgroundColor = Color(20, 128);

Callers 1

drawMethod · 0.85

Calls 1

absFunction · 0.85

Tested by

no test coverage detected