MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / FormatValue

Method FormatValue

Source/Engine/Profiler/ProfilerGPU.cpp:246–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244 }
245
246 static const Char* FormatValue(Char* buffer, int64 value)
247 {
248 // Format value with thousands separators (fmt has disabled FMT_USE_LOCALE_GROUPING)
249 fmt_flax::allocator allocator;
250 fmt_flax::memory_buffer fmtBuffer(allocator);
251 fmt_flax::format(fmtBuffer, TEXT("{}"), value);
252 const StringView str(fmtBuffer.data(), (int32)fmtBuffer.size());
253 int32 step = 0;
254 int32 size = str.Length() + (str.Length() - 1) / 3;
255 buffer[size--] = 0;
256 for (int32 i = str.Length() - 1; i >= 0; i--)
257 {
258 buffer[size--] = str[i];
259 if (++step == 3 && i != 0)
260 {
261 step = 0;
262 buffer[size--] = ',';
263 }
264 }
265 return buffer;
266 }
267};
268
269GraphicsDumping* Dumping = nullptr;

Callers 1

DrawMethod · 0.80

Calls 4

formatFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
LengthMethod · 0.45

Tested by

no test coverage detected