MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetParamMaxValue

Function GetParamMaxValue

src/strings.cpp:236–244  ·  view source on GitHub ↗

* Get some number that is suitable for string size computations. * @param max_value The biggest value which shall be displayed. * For the result only the number of digits of \a max_value matter. * @param min_count Minimum number of digits independent of \a max. * @param size Font of the number * @returns Number to use for string size computations. */

Source from the content-addressed store, hash-verified

234 * @returns Number to use for string size computations.
235 */
236uint64_t GetParamMaxValue(uint64_t max_value, uint min_count, FontSize size)
237{
238 uint num_digits = 1;
239 while (max_value >= 10) {
240 num_digits++;
241 max_value /= 10;
242 }
243 return GetParamMaxDigits(std::max(min_count, num_digits), size);
244}
245
246static void StationGetSpecialString(StringBuilder &builder, StationFacilities x);
247static bool GetSpecialNameString(StringBuilder &builder, StringID string, StringParameters &args);

Callers 15

UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
DrawWidgetMethod · 0.85
UpdateWidgetSizeMethod · 0.85
ComputeGroupInfoSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85

Calls 1

GetParamMaxDigitsFunction · 0.85

Tested by

no test coverage detected