Adding a Comma in Display Text?

JDuaneJJDuaneJ San Francisco Member Posts: 300

Is this possible? If I wanted to display 1,000 instead of 1000.

Best Answer

  • TheGabfatherTheGabfather Posts: 633
    Accepted Answer

    Yeaahhh, a quick Google search of "Gamesalad commas" gives you this resulting page. There are two methods highlighted in that thread, you can just choose which you need :)

Answers

  • JDuaneJJDuaneJ San Francisco Member Posts: 300

    Dang I knew it, i did a search too. Thanks for your help!

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    I guess you could also create a game text attribute and call it comma. Give it a comma value.

    In your expression, you could do something like this:

    game.score..game.comma..etc etc

    I believe that would work, but it's really not necessary as there are easier ways. Just thought I'd post this in case it helps someone in the future.

  • JDuaneJJDuaneJ San Francisco Member Posts: 300

    I just tried the crazy long expression route in the forum link shared by @TheGabfather. Seems to be ok for prototyping, but I doubt I would use it in production. I think the best solution was the last one, displaying a "Custom Font Comma" that is just hidden until game.score > 999 etc.

    I just wanted something while I'm prototyping crap so my score felt more complete. Thanks guys!

  • TheGabfatherTheGabfather Member Posts: 633

    Actually, it only appears to be a bloated expression because it deals with numbers up to the millions. You can trim it down as per your needs, starting from the left.

    In traditional programming, you would probably use something like it as well -- floor functions and a lot of modulo (%). Even mathematical stored procedures make use of them under the hood.

    The idea is that it might seem long and ergo might produce performance hiccups, but in truth it's just peanuts for your computer or device to compute.

    But, to each his own :) good luck with your latest game!

Sign In or Register to comment.