- edited description
Tinkering bit locker misrenders numbers greater than 999
Issue #3572
resolved
The tinkering screen doesn’t properly display numbers >= 1000. It displays the first three digits, so that a player with 1234 <B> bits will instead see “123”.
Yes, I’ve been playing too long.
Just for giggles, here’s a trick I use to fit arbitrary values into 4 characters, with 3 significant digits.
std::ostream& perilymph_calibrator::operator<<(std::ostream &out, Print_3SD d)
{
size_t sig = d.n * 100, i = 0;
for (; i < 5; ++i, sig /= 1000) if (sig < 100'000 || i == 4) break;
const char *units = ".kmbtq";
char unit = units[i];
if (sig < 1000) /* 1k23 */ out << (sig/100) << unit << ((sig/10)%10) << (sig%10);
else if (sig < 10000) /* 12k3 */ out << (sig/100) << unit << ((sig/10)%10);
else /* 123k */ out << (sig/100) << unit;
return out;
}
Comments (4)
-
reporter -
repo owner -
assigned issue to
-
assigned issue to
-
- changed status to open
-
- changed status to resolved
Fixed in last update.
- Log in to comment