| 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 | |
| 269 | GraphicsDumping* Dumping = nullptr; |