MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / prettify

Function prettify

Source/3rdParty/bx/src/string.cpp:1298–1315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1296
1297 template<uint32_t Kilo, char KiloCh0, char KiloCh1, CharFn fn>
1298 inline int32_t prettify(char* _out, int32_t _count, uint64_t _value)
1299 {
1300 uint8_t idx = 0;
1301 double value = double(_value);
1302 while (_value != (_value&0x7ff)
1303 && idx < BX_COUNTOF(s_units) )
1304 {
1305 _value /= Kilo;
1306 value *= 1.0/double(Kilo);
1307 ++idx;
1308 }
1309
1310 return snprintf(_out, _count, "%0.2f %c%c%c", value
1311 , fn(s_units[idx])
1312 , idx > 0 ? KiloCh0 : '\0'
1313 , KiloCh1
1314 );
1315 }
1316
1317 int32_t prettify(char* _out, int32_t _count, uint64_t _value, Units::Enum _units)
1318 {

Callers 7

submitMethod · 0.85
initMethod · 0.85
submitMethod · 0.85
submitMethod · 0.85
initMethod · 0.85
initMethod · 0.85
submitMethod · 0.85

Calls 1

snprintfFunction · 0.70

Tested by

no test coverage detected