Jump to content


Photo

round to intgers


  • Please log in to reply
2 replies to this topic

#1 _250968

_250968

    GMC Member

  • New Member
  • 28 posts

Posted 08 March 2012 - 04:15 AM

i am not sure when you will need this code
but if you do you don't have to credit since i haven't come up a gmc name yet,
the code is
a=a-(a mod 1)
easy and short
a is the number you want to round
  • 0

#2 _250968

_250968

    GMC Member

  • New Member
  • 28 posts

Posted 08 March 2012 - 04:17 AM

i think i might post it in the wrong section
so if you know where to move it
please tell me
and thx

Edited by _250968, 08 March 2012 - 04:19 AM.

  • 0

#3 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • Retired Staff
  • 9259 posts
  • Version:Unknown

Posted 08 March 2012 - 04:23 AM

What's wrong with round(), floor(), and ceil()? Or, if you're going to go the long way, what's wrong with a-frac(a)?

-IMP

Edited by IceMetalPunk, 08 March 2012 - 04:24 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users