Limiting Time Display

BluSpyderBluSpyder Member Posts: 129
edited February 2012 in Working with GS (Mac)
I have a timer going by 0.1. While displaying this, some times it will display like 4.23882. I only want to display one decimal place, is there someway to force this to prevent from displaying more than one decimal place?

Comments

  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    What do you use?

    Every 0,1sec
    change attribute to attribute + ...?

  • BluSpyderBluSpyder Member Posts: 129
    edited February 2012
    Every 0.1 sec (run to completion) -> Change attribute game.timer to game.timer+0.1

    Also tried interpolate (duration 0.1) instead of change attribute but i dont think that added up right anyways.
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Look at this video, I think tshirtbooth tells how just to display
    one decimal also...



    Alex
  • BluSpyderBluSpyder Member Posts: 129
    thank for the link. This works perfect except is there someway to hide an unnecessary 0? I deleted some of the formula so it shows 00.0 as seconds. (05.0 = 5 seconds), but i wonder if you can hide the 0 before 5 while it's unused?
  • BluSpyderBluSpyder Member Posts: 129
    i don't know if this was the best efficient solution, but i fixed it like this for future reference:

    Rule -> if game.timer is < 10 then display (0.0 formula)
    --->otherwise display (00.0 formula)
  • a1000milesa1000miles Member Posts: 36
    edited June 2013
    Thanks for posting this video link @GuaveGames. I just used the information to display a self time in seconds by using floor((self.Time%60/10)..floor(self.Time%10). Works just great (even though as a complete newbie, I have no idea what it's actually doing)
Sign In or Register to comment.