Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | turtilla955 |
I know I can use int()
to kind of do this but I don’t know how to display the int value. I am trying to display a variable btw
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | turtilla955 |
I know I can use int()
to kind of do this but I don’t know how to display the int value. I am trying to display a variable btw
Reply From: | Enfyna |
Did you try :
$label.text = str(int(variable))
Reply From: | jgodfrey |
As another option, you can simply format the output as an int. So, this:
var v = 36.275
print("%d" % v)
prints 36
Or, to assign to a Label
, this:
$Label.text = "%d" % v