1
0
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:
Gymnasiast
2019-04-20 18:42:06 +02:00
parent abf416a5a9
commit 28ad78f204

View File

@@ -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);