I need help using the "ceil" function to round out numbers

bajashbajash Member, PRO Posts: 215
edited March 2012 in Working with GS (Mac)
Hi All,

Finally got to where i want with my app. I just need to round out my numbers out output to
10ths, without 4 places after the decimal so a reading of 8.2345 would read 8.2

My current code is Display text:
atan(game.Accelerometer.X)+45

Where would I add my ceil function to achieve this.

Thank you

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Well, ceil will round 8.2345 UP to 9 while floor will round it down to 8. Both ceil and floor give you an integer.

    So you will need to do (floor((atan(game.Accelerometer.X)+45)*10))/10
  • Rob2Rob2 Member Posts: 2,402
    or prec((atan( game.Accelerometer.X )+45),1) would also work
  • bajashbajash Member, PRO Posts: 215
    Awesome! Thank you
Sign In or Register to comment.