The Daily Click ::. Forums ::. Klik Coding Help ::. Rounding Decimals in Expression Editor
 

Post Reply  Post Oekaki 
 

Posted By Message

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
24th June, 2010 at 00:35:51 -

Should be a simple solution . . . I believe it has to do with MOD ? Could someone please explain that to me?

Example code

Start of Frame - Set Counter to 10

Upon Pressing Enter
Set Counter to Counter Value *1.06 - I want the result rounded.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
24th June, 2010 at 00:50:12 -

Nope - it's more blindingly obvious than that.
"Mod" returns the remainder of a division
"Round" rounds a number normally (ie. up if >=n.5, or down if <n.5)
"Floor" always rounds down ("Int" does virtually the same thing - it's just a bit different with negative numbers)
"Ceiling" always rounds up

Since you're using a counter though, you could just change the number of significant figures in the object properties (I believe this would only change the value displayed, but not the actual value being stored - haven't tested it though).

Edited by Sketchy

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
24th June, 2010 at 01:12:52 -

Aha.

Thanks again, Sketchy.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click