How do i display a number with a decimle value as a whole number in a label

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: 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

:bust_in_silhouette: Reply From: Enfyna

Did you try :

$label.text = str(int(variable))
:bust_in_silhouette: 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