#✅ | How to round number health points
1 messages · Page 1 of 1 (latest)
Yep 🙂 For SpiffyHUD/FancyMenu, the documented way is to wrap the health placeholder in the calc placeholder and set decimal to false.
Use this:
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"current_player_health"}"}}
That makes current_player_health show as a whole number instead of a decimal.
If you want, I can also help you put it into a full HUD text line like HP: 20 or format it with hearts ❤️
To 1 point after decimal
Checking whether FancyMenu lets you keep exactly 1 decimal place too 🙂 If there’s a documented calc setting for that, I’ll give you the exact snippet.
I couldn’t find a documented way to force exactly 1 decimal place for that placeholder 😕
What the docs do show is the Calculator placeholder with decimals enabled:
{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"current_player_health"}"}}
So:
decimal":"false"= whole numberdecimal":"true"= decimal output
But the docs do not mention a built-in option for “1 digit after the decimal”.
If you want, I can help check whether there’s another formatter in FancyMenu that can do 1.0-style display for you 🙂
We cant use math round?
Checking if FancyMenu’s calculator supports a round()-style function for this 🙂 If yes, I’ll give you the exact format.
Yep, you can use math_round 🙂
That’s the documented round placeholder, not a round() function inside calc.
For 1 decimal place, use:
{"placeholder":"math_round","values":{"num":"{"placeholder":"current_player_health"}","decimals":"1"}}
So if your health is 18.37, this should show 18.4.
If you want, I can also help you wrap that into a full text like HP: 18.4 💛