Page 1 of 1

[Solved]Display integer value with a decimal point

Posted: Thu Apr 25, 2024 10:05 am
by Dark79
Hello,

Is there a way to display integer value with a decimal point? It's like you can place decimal point anywhere in the integer value for display purposes.

For example.

Code: Select all

default var= 100

screen TestScreen():
    text "[var]" xalign 0.5 #here show as if the value is being displayed as 1.00 instead 100
	

Re: Display integer value with a decimal point

Posted: Thu Apr 25, 2024 11:06 am
by Dark79
Figured it out. Just in case if someone else needs it.

Code: Select all

default var= 100

screen TestScreen():
    text "{0:.2f}".format(var / 100) xalign 0.5