Decimals #2
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We currently are using you ServerShop and it's perfect, however is it possible to implement decimals for prices e.g 1.00? As I'm adding all the prices from my datapack however they all include decimals, and I'm currently circumventing this issue by using a scale factor of 100 e.g 1.23 => 123.
Thanks for the ServerShop!!!
I intended to use the scale factor.
Is it really needed?
Technically it is possible
Or I can just divide it by 100 when displaying to keep it fixed decimal point
Yeah even on my datapack I started off using whole number then just dividing it by 100 when displaying which made things way easier. Another method I tried was storing the whole number as price1 and the decimals as price2 but that was way more complex.
I could implement it as true floating point if I wanted to
Ow you could is it that not complex? I've had many issues trying to store a float value on scoreboard since it only handles integers.
This is a java mod. I have access to normal code. It would not be that complex actually
Ow would you not have to make major changes tho? Also how do you handle the price.dat info I'm currently adding this one by one, I'm trying to write a python code to convert snbt to nbt but having to errors as my datapack uses json.
I've just realised how much quicker /shop edit XD
This project has a CSV import as well. It can't import item metadata though.
I included the csv price thing.
And for the dat, it is a normal NBT file. Try it with a minecraft NBT editor.
There surely is a python option.
Everything about price storage is here: https://git.brn.systems/BRNSystems/ServerShop/src/branch/main/src/main/java/systems/brn/servershop/lib/storages/PriceStorage.java
Feel free to explore the code.
I began editing the prices file, should I continue to use the scale factor method of wait until a decimals update?
Thanks.
Could you test this build for me?
https://modrinth.com/mod/servershop/version/ZvaH9AeR
sure
Is it working?
Works perfectly!!!
There seems to be an error when trying /balance list, I get incorrect argument as a player and the second error as admin.
Is this an offline mode server?
I have added a check here so it does not crash.
The next release will have it.