User Tag List

Results 1 to 3 of 3

Thread: how to make sure a result is always rounded UP

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    how to make sure a result is always rounded UP

    Hi everyone,

    I need to define a number of sets of something...

    for example, if there are 501 apples, I want mmf to devide 501 into groups of 100, but to know that there are 6 sets...5 sets of 100, and a last set of 1.

    So,I want to set the value"sets" to 501/100 and get the value of 6.

    any idea how I do this?

    thanks

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how to make sure a result is always rounded UP

    You can use the floor(), ceil() and round() expressions to round down, up or to the nearest whole number, respectively.

    In your example, use ceil(501/100.0) - the division will result in 5.01, which is then rounded up to 6.

    The ".0" at the end of 100 is important, as it tells MMF that we don't want the division to be rounded to a whole number too early - without that, 501/100 would work out as 5, and ceil(5) would still be 5.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: how to make sure a result is always rounded UP

    Thanks much DavinN,

    I really apreciate how helpful you are in the Click community.

Similar Threads

  1. problem with digit result
    By arthurh in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th September 2013, 02:26 PM
  2. Background/Active System Box - Rounded Borders?
    By LB in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th February 2010, 07:35 PM
  3. ActiveX:get result from method -actually possible?
    By Quinto in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd June 2008, 05:32 PM
  4. [ REQUEST - PHP Result Parser ]
    By MelliGeorgiou in forum Extension Development
    Replies: 12
    Last Post: 29th May 2008, 12:43 PM
  5. [solved] Division is returning a rounded number
    By cdahmedeh in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 10th March 2007, 05:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •