The Daily Click ::. Forums ::. Klik Coding Help ::. How do you get decimals to round up in mmf?
 

Post Reply  Post Oekaki 
 

Posted By Message

Zane



Registered
  09/09/2003
Points
  1183
25th November, 2003 at 15:42:20 -

How do you get decimals to round up in mmf?
I have a value that needs to be calculated useing division, its a percentage if it helps. The problem is that the divison is causeing decimal places, and mmf cannot show decimal places. The counter is just cuting out the decimal place and so the number displayed is much higher. Is there a way to round he decimals up? Or is there some other reason this is happening? Or is there a way to show decimal places?

 
www.klikforever.co.uk
GO THERE!!!

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
25th November, 2003 at 20:44:09 -

Use the INT(number) function. number is whatever number it is, and it always rounds down. It also allows variables inside it.

 
http://www.klik-me.com

Zane



Registered
  09/09/2003
Points
  1183
26th November, 2003 at 02:59:12 -

ok, thanx

 
www.klikforever.co.uk
GO THERE!!!

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
26th November, 2003 at 04:43:36 -

Apparently if you show decimal places in the values in the calculation it will show decimal places in the answer, but I haven't tried that yet.

 
http://www.davidn.co.nr - Games, music, living in America

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
26th November, 2003 at 08:31:39 -

If you're specific about rounding up,

Ceil(2.6) = 3

Otherwise Int() works fine. (It rounds up or down, whichever is nearest, lazy function that it is)

 
gone fishin'

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
26th November, 2003 at 21:37:54 -

I actually think INT() only rounds down, I tried it with 3.9 and it ended up being 3.

 
http://www.klik-me.com

Zane



Registered
  09/09/2003
Points
  1183
27th November, 2003 at 09:04:06 -

Thankyou people. it worked on one of my values, not sureabout the other as mmf wont calculate it. Its only a god damn percentage as well. Im going to have to compleatly rethink things. anyways, thanx for your help.

 
www.klikforever.co.uk
GO THERE!!!

Zane



Registered
  09/09/2003
Points
  1183
28th November, 2003 at 05:55:17 -

A-ha. all is fine now. thanx people

 
www.klikforever.co.uk
GO THERE!!!
   

Post Reply



 



Advertisement

Worth A Click