Need help about integer...

sebmacflysebmacfly Member Posts: 1,018
edited November -1 in Working with GS (Mac)
Hi everyone!

I need help about my integer attribute.
I need to display it in game, but if it's a high number, i want to display it like 100.000 (not 100000), adding the "."
2nd exemple, 10.000 (not 10000)

Any way to do it?

Thank you very much!

Comments

  • sebmacflysebmacfly Member Posts: 1,018
    tshirtbooth said:
    are you talking for like time based?
    10.013 seconds?

    No Tshirtbooth, just want to display text : 100.000 (for a 100000 integer value) i don't want to display 100000$ (without the dot)

    Thanks ;)
  • sebmacflysebmacfly Member Posts: 1,018
    I'll make it for europe and US... thanks for the info...

    WOW that's strange lol... That works for 10000 and 1000 too? (1,000 10,000)

    Thank you very much ;)
  • JackBQuickJackBQuick Member Posts: 524
    tshirtbooth said:
    "$"..floor(floor(( game.score/3600)/60)/10)..floor((floor( game.score%3600)/60)%10)..floor(( game.score%60)/10)..","..floor( game.score%10)..(floor( game.score*10)%10)..floor(floor( game.score*100)%10)

    Hi, tshirtbooth, there's some 3600's and 60's in there that I'm not sure should be there (since it's not time based).
  • sebmacflysebmacfly Member Posts: 1,018
    CLAP CLAP CLAP!!!! :D

    How the hell you can do an insane expression like that? lol
    (i'll try that later)
  • sebmacflysebmacfly Member Posts: 1,018
    JackBQuick said:
    Hi, tshirtbooth, there's some 3600's and 60's in there that I'm not sure should be there (since it's not time based).

    Hummmm.... It's not time based... Maybe you're right, why 3600 and 60?
  • sebmacflysebmacfly Member Posts: 1,018
    tshirtbooth said:
    "$"..floor(floor(( game.score/3600)/60)/10)..floor((floor( game.score%3600)/60)%10)..floor(( game.score%60)/10)..","..floor( game.score%10)..(floor( game.score*10)%10)..floor(floor( game.score*100)%10)

    TSB, please help, that does'nt work... what's wrong?

    Thanks a lot man ;)
  • JackBQuickJackBQuick Member Posts: 524
    Try this:

    floor( game.score /1000).."."..floor(( game.score -floor( game.score /1000)*1000)/100)..floor(( game.score -floor( game.score /100)*100)/10)..floor(( game.score -floor( game.score /10)*10)).." "

    ----------

    Remember that you have to use the Expression Editor to put in game.score (or whatever attribute name you are using). Be careful: each and every parenthesis is important. (Those are the round brackets.)

    I actually made a demo for you but there were some problems with publishing it. This expression does work though. I don't know exactly why it needs the .." " at the end but it does. (That's an alt-space between the quotes.)

    And, I would have a rule in place so that it displays the unaltered number if it is less than a thousand, and the above expression otherwise.

    Good luck!
  • sebmacflysebmacfly Member Posts: 1,018
    HI....

    Thanks, but don't works... for 100000 the display is 100 and for 99600, the display is 99.60 :S
  • JackBQuickJackBQuick Member Posts: 524
    I made sure this worked before posting the expression.

    Try by counting the round brackets (there should be 20).

    Then, ensure that the brackets are all in the right places.

    Also, make sure that the expression ends in .." " (period, period, quote, alt-space, quote).

    In addition, ensure you have the correct number of zeros as well.

    In other words: everything has to be exactly the same in order for this to work.
  • sebmacflysebmacfly Member Posts: 1,018
    JackBQuick said:
    I made sure this worked before posting the expression.

    Try by counting the round brackets (there should be 20).

    Then, ensure that the brackets are all in the right places.

    Also, make sure that the expression ends in .." " (period, period, quote, alt-space, quote).

    In addition, ensure you have the correct number of zeros as well.

    In other words: everything has to be exactly the same in order for this to work.

    Thank you, i'll try it later (when i'll be back to home)
  • JackBQuickJackBQuick Member Posts: 524
    I'll try to publish the demo again when it's possible. In the meantime, you can download it from here:

    Thousands seperator demo

    I think that you can download it and then use GameSalad to open it up. Each click on the screen will generate a random number between 1 and 100.000.
  • sebmacflysebmacfly Member Posts: 1,018
    JackBQuick said:
    I'll try to publish the demo again when it's possible. In the meantime, you can download it from here:

    Thousands seperator demo

    I think that you can download it and then use GameSalad to open it up. Each click on the screen will generate a random number between 1 and 100.000.

    Thank you man, i'll let you know ;)
  • sebmacflysebmacfly Member Posts: 1,018
    Works like a charm! THANKS ;)
    Great job
Sign In or Register to comment.