Factor out function to get value with broadest digits

This commit is contained in:
Jonathan G Rennison
2023-06-01 20:34:48 +01:00
parent 18a79a35d0
commit a10c5a62c9
3 changed files with 20 additions and 8 deletions

View File

@@ -116,14 +116,7 @@ void SetDParamMaxValue(uint n, uint64 max_value, uint min_count, FontSize size)
*/
void SetDParamMaxDigits(uint n, uint count, FontSize size)
{
uint front = 0;
uint next = 0;
GetBroadestDigit(&front, &next, size);
uint64 val = count > 1 ? front : next;
for (; count > 1; count--) {
val = 10 * val + next;
}
SetDParam(n, val);
SetDParam(n, GetBroadestDigitsValue(count, size));
}
/**