pafvel / dragonbane

Other
11 stars 6 forks source link

Bug: Weird calculations in inventory #41

Closed Azazel666 closed 4 months ago

Azazel666 commented 4 months ago

At some numbers the calculations for weight in the inventory becomes weird. Example: The item bandages is bought and contains 10 bandages in total and they have a weight of 1 for the item. that means 10x0.1 = 1. So we have setup the item as such.

On my character i one bought bandages and have since then used 3, so i'm left with 7 which should be shown as 0.7 in my pack. But this is for some reason showing 0.7000000000000001 instead. But this only happens on some quantity values, between 1-10 this happens on 3, 6 & 7 for me. 2024-03-03 16_03_34-Foundry Virtual Tabletop - Opera

On quantity 6 it also shows as 0.6000000000000001. 2024-03-03 16_10_08-Foundry Virtual Tabletop - Opera

But on 3 it shows 0.30000000000000004. 2024-03-03 16_11_07-Foundry Virtual Tabletop - Opera

pafvel commented 4 months ago

Fixed by https://github.com/pafvel/dragonbane/commit/cd8a1ae09ecf530bd5a052fdf1465fe8c21964c0