#✅ | How to round number health points

1 messages · Page 1 of 1 (latest)

floral latchBOT
#

Checking the docs for the placeholder formatting options now 🙂 If there’s a built-in way to round current_player_health, I’ll point you to it right away.

#

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 ❤️

severe furnace
#

To 1 point after decimal

floral latchBOT
#

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.

floral latchBOT
# severe furnace To 1 point after decimal

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 number
  • decimal":"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 🙂

severe furnace
#

We cant use math round?

floral latchBOT
#

Checking if FancyMenu’s calculator supports a round()-style function for this 🙂 If yes, I’ll give you the exact format.

floral latchBOT
# severe furnace We cant use math round?

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 💛