Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rolldata Display is not sensibly rounded #4918

Open
revilowaldow opened this issue Dec 23, 2024 · 3 comments
Open

Rolldata Display is not sensibly rounded #4918

revilowaldow opened this issue Dec 23, 2024 · 3 comments

Comments

@revilowaldow
Copy link

I've got a monster that does less damage based on it's current HP.
The damage formula is (@attributes.hp.pct/100) * 10d10.
The current HP of the monster in this example is 57 of a 100HP maximum.
The display on the sheet is:
image
The sheet display should avoid precision errors or intentionally round as some HP values can actually be quite long decimals.
e.g. 10/15 would be a recurring decimal

@JPMeehan
Copy link

Seems like a much easier fix on your end, given how division beyond 2 and 4 just doesn't exist in the normal rules. Wrap the @ value in round() then do your division.

@revilowaldow
Copy link
Author

It's not even about the rounding, the value in the example should be 57 but it's shown as 56.999999999999 due to JavaScript precision errors. It's definitely something for the system to fix.

@krbz999
Copy link
Contributor

krbz999 commented Dec 24, 2024

Rounding to two decimals would probably save a few minor headaches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants