//
// GameToolbox::intToShortString from 0x2eff9c to 0x2f00d0 (308 bytes)
//
// 7 xrefs:
// > LevelCell::loadCustomLevelCell @ 0x332d6e
// > LevelCell::loadCustomLevelCell @ 0x332eb2
// > LevelListCell::loadFromList @ 0x33af62
// > LevelListCell::loadFromList @ 0x33b086
// > LevelListLayer::updateStatsArt @ 0x58ffb6
// > LevelListLayer::updateStatsArt @ 0x5900fa
// > LevelListLayer::updateStatsArt @ 0x590570
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
GameToolbox *__fastcall GameToolbox::intToShortString(GameToolbox *this, int a2)
{
int v2; // r6
float v4; // s15
char *v5; // r3
char *v6; // r0
unsigned int v8[3]; // [sp+Ch] [bp-204h] BYREF
char v9; // [sp+18h] [bp-1F8h] BYREF
v2 = a2;
v8[1] = 500;
v8[0] = 0;
v8[2] = (unsigned int)&v9;
if ( a2 < 0 )
{
v2 = -a2;
fmt::BasicWriter::operator<<(v8, "-", 0);
}
if ( v2 >= 1000 )
{
v4 = (float)v2;
if ( v2 > 9999 )
{
if ( v2 > 999999 )
{
floorf(v4 / 100000.0);
fmt::BasicWriter::operator<<((int)v8);
v5 = "M";
}
else
{
floorf(v4 / 1000.0);
fmt::BasicWriter::operator<<((int)v8);
v5 = "K";
}
}
else
{
floorf(v4 / 100.0);
fmt::BasicWriter::operator<<((int)v8);
v5 = "K";
}
fmt::BasicWriter::operator<<(v8, v5, 0);
}
else
{
fmt::BasicWriter::operator<<(v8, v2);
}
v6 = (char *)fmt::BasicWriter::c_str((int *)v8);
sub_776584((int)this, v6);
fmt::internal::Array::free((int)v8);
return this;
}