mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Allow entry of numbers up to 10 million in string_to_money
This commit is contained in:
@@ -1513,7 +1513,7 @@ money32 string_to_money(const char* string_to_monetise)
|
||||
|
||||
auto number = std::stod(processedString, nullptr);
|
||||
number /= (currencyDesc->rate / 10.0);
|
||||
auto whole = static_cast<uint16_t>(number);
|
||||
auto whole = static_cast<int32_t>(number);
|
||||
auto fraction = static_cast<uint8_t>(ceil((number - whole) * 100.0));
|
||||
|
||||
money32 result = MONEY(whole, fraction);
|
||||
|
||||
Reference in New Issue
Block a user