display decimal point without the 0 behind.

ultimaultima Member, PRO Posts: 1,207

Hi friends, i know you can set the numbers to display a certain number of 0's after the decimal point. but is there a way to display 123. without getting into text string etc. thanks in advance.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2016

    No, not if you want the decimal point. The expression would need to be round(game.number).."."

    I thought maybe padReal(game.number,4,0) would work but using 0 as the last parameter results in unpredictable values.

    padReal(x,y,z) is similar to padInt, but it takes the attribute x, with a minimum number of characters(including the decimal) y, and z digits to the right of the decimal.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ultimaultima Member, PRO Posts: 1,207

    thank you, yes i'd have to go into all the numbers and add the text string =) maybe i should have designed it to display text string in the first place and convert to numbers.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You don't have to add a text attribute. Wherever you have your Display Text, just change it from game.number to game.number.."."

    Yes, you have to open the expression editor, but it's not different than if you had to round the number, for example.

    Another option would be to add a second Display Text with just the period (.) in the field and position it to the right of the number. That's a much more clunky method.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.