Price precision. data integrity question.
NullCase opened this issue ยท 5 comments
Hi @Phoenix616
This is a question about the decimal place limit added in Chestshop-103. Default being 2 decimals.
I notice that in Chestshop-132 you improved the precision of calculations. Was that to solve a data integrity/money printing issue?
The reason I'm asking is because I want to offer price precision down to 4 decimal places. It seems to work fine in testing. Is there an issue with adding precision which I'm not aware of?
You're welcome to close this after responding. I'll ship some $ over as a thank you. (pretty sure I have your paypal).
Thanks!
The commit of build 132 was made to resolve potential errors when calculating the price due to rounding to the precision getting applied too soon. It changed it so that the rounding is only done at the end of the calculation.
As for the precision support: Internally the plugin uses BigDecimals instead of just doubles to handle any money calculations now so any precision shouldn't be an issue for the plugin itself.
There are only some potential issues with the Vault Economy adapter as it only supports doubles so we still have to convert to a less precise data format when passing transactions to Vault.
This should not result in issues with 4 decimal places though, I think I've only ever seen them when more than 8 were used, so you should be pretty safe setting it to that.
Yeah ;) I had send you a message regarding that on Spigot too but either that's not jour account or you're not active there? Anyways, thanks for the tip. :)
@Phoenix616 did I mess something up here? because I see that post was removed.
Come to think of it, I wouldn't want anyone in Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu seeing any of my transaction details either. :)