PDA

View Full Version : Problems rounding coins



YAKO SOMEDAKY
September 9th, 2022, 04:25
I'm not very good with numbers, but I made the extension that creates the stores for the RMC, however the conversion part of the following currencies is not going in whole and I don't know what to do to fix it.
The coins that give the broken values are these:
MP to CP
PP to TP
GP to IP


And this is the link to the extension (https://forge.fantasygrounds.com/shop/items/828/view)

Dakadin
September 9th, 2022, 07:18
Hi yako2020,

Nothing has changed in the ruleset in regard to currencies since CoreRPG added the weight and conversion amounts. You can look at them in Options by clicking the Currencies button or even change them from there. Here is a screenshot: 54274

Dakadin

YAKO SOMEDAKY
September 9th, 2022, 14:14
54282 54283 542845428554285
Here are some screenshots of Currency Converter and the "error".

Moon Wizard
September 9th, 2022, 15:51
That seems like it's a problem with the logic in the currency conversion routine then. The CoreRPG currency data merely provided weight and relative value per coin. There's no logic built-in to do any conversions.

Regards,
JPG

YAKO SOMEDAKY
September 9th, 2022, 17:54
Yes I know that, the conversion part is for making purchases in stores, all other conversions work normally, but these happen what I showed in the screenshots.

Dakadin
September 9th, 2022, 18:02
Then the extension will need to be updated to resolve that issue.

Dakadin
September 9th, 2022, 18:34
Thinking about it my guess is the extension isn't taking into account the number of coin types in RM compared to other games like D&D so when the spread between coins gets to be more than that then it breaks down.

YAKO SOMEDAKY
September 9th, 2022, 18:39
The strange thing is that the problem only occurs in the conversion of the 100 thousand, in these currencies, but everything goes well.

Dakadin
September 9th, 2022, 18:57
That makes sense. D&D only has 5 currencies. RM has 8. So once you get 10 to the 5th power you are likely hitting the limit of what it is expecting.

YAKO SOMEDAKY
September 9th, 2022, 19:39
Here are the screenshots of the conversion of coins.

54289 54290 54291 54292

YAKO SOMEDAKY
September 9th, 2022, 19:41
Another screenshots of coins conversion

54293 54294 54295 54296

Dakadin
September 9th, 2022, 20:45
The extension author is going to need to look at how to get the conversion code updated to handle the extra coin options.

YAKO SOMEDAKY
September 10th, 2022, 00:55
Okay, problem solved...thank you all.