Changeset - r28780:365899ab5941
[Not reviewed]
master
0 1 0
Rubidium - 10 months ago 2024-02-17 21:06:39
rubidium@openttd.org
Fix a253205: division by zero when attempting to format some short currencies
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/strings.cpp
Show inline comments
 
@@ -401,13 +401,13 @@ void InitializeNumberFormats()
 
	if (!_settings_client.gui.number_abbreviations.empty()) {
 
		auto res = ParseNumberAbbreviations(_number_abbreviations, _settings_client.gui.number_abbreviations);
 
		if (res.has_value()) UserError("The setting 'number_abbreviations' under 'gui' is invalid: {}", *res);
 
		loaded_number_abbreviations = !res.has_value();
 
	}
 
	if (!loaded_number_abbreviations) ParseNumberAbbreviations(_number_abbreviations, _current_language->number_abbreviations);
 
	_number_abbreviations.emplace_back(0, _number_format_separators);
 
	_number_abbreviations.emplace_back(1, _number_format_separators);
 
}
 

	
 
/**
 
 * Format a number into a string.
 
 * @param builder The string builder to write to.
 
 * @param number The number to write down.
0 comments (0 inline, 0 general)