Display just two numbers after "."

dlaimdlaim Member Posts: 110

Hi everybody

i have a real game score attribute , and i want to display it with two numbers after point .

ForExample ::

game.score = 4.8945654

i want to change it to ==> 4.89

How can i do that ?

Thank's ..

Comments

  • MantoManto Member Posts: 796
    edited May 2014

    Use the prec function in expression editor.

    Display Text
    prec(game.score,2)

  • SocksSocks London, UK.Member Posts: 12,822

    RoundTo(game.score,2)

    The precision function (Prec) is said to be less efficient as it needs to be converted into text, the recomendation is now to use RoundTo.

  • dlaimdlaim Member Posts: 110

    @Manto1 , @Socks‌

    Thank you ...

Sign In or Register to comment.