MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / AddCommas

Function AddCommas

PresentData/Debug.cpp:39–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39char* AddCommas(uint64_t t)
40{
41 static char buf[128];
42 auto r = sprintf_s(buf, "%llu", t);
43
44 auto commaCount = r == 0 ? 0 : ((r - 1) / 3);
45 for (int i = 0; i < commaCount; ++i) {
46 auto p = r + commaCount - 4 * i;
47 auto q = r - 3 * i;
48 buf[p - 1] = buf[q - 1];
49 buf[p - 2] = buf[q - 2];
50 buf[p - 3] = buf[q - 3];
51 buf[p - 4] = ',';
52 }
53
54 r += commaCount;
55 buf[r] = '\0';
56 return buf;
57}
58
59}
60

Callers 3

PrintTimeFunction · 0.85
PrintTimeDeltaFunction · 0.85
PrintEventHeaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected