fairyoggy Posted September 27, 2019 Share Posted September 27, 2019 local health1 = getElementHealth(getPlayerFromName(player)) guiSetText(label1, "HP: "..health1.. " %") How to change digit display format? Now display like this but how to make that there would be a maximum of 2 digits after the decimal point 26.39 % Link to comment
VenomOG Posted September 27, 2019 Share Posted September 27, 2019 local health1 = getElementHealth(getPlayerFromName(player)) guiSetText(label1, "HP: "..math.round(health1,2).. " %") Try this 2 hours ago, slapz0r said: local health1 = getElementHealth(getPlayerFromName(player)) guiSetText(label1, "HP: "..health1.. " %") How to change digit display format? Now display like this but how to make that there would be a maximum of 2 digits after the decimal point 26.39 % Link to comment
Scripting Moderators ds1-e Posted September 27, 2019 Scripting Moderators Share Posted September 27, 2019 1 minute ago, Network said: local health1 = getElementHealth(getPlayerFromName(player)) guiSetText(label1, "HP: "..math.round(health1,2).. " %") Try this You should include this: https://wiki.multitheftauto.com/wiki/Math.round This is not built-in, but an useful function. Link to comment
VenomOG Posted September 27, 2019 Share Posted September 27, 2019 Just now, majqq said: You should include this: https://wiki.multitheftauto.com/wiki/Math.round This is not built-in, but an useful function. Yes true, i didnt see sorry Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now