User Tag List

Results 1 to 5 of 5

Thread: Round up to the nearest integer?

  1. #1
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    MasochisticGamer's Avatar
    Join Date
    Nov 2012
    Location
    Gravois Mills. MO USA
    Posts
    76
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Round up to the nearest integer?

    Making a sliding scale app for a friend. Needing to know how to round a decimal up to the next whole number if the decimal is 5 or higher. Thanks in advance.

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)
    ratty's Avatar
    Join Date
    Apr 2012
    Posts
    1,112
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Have you tried the Int() parameter?

    Int(your_calculation)

  3. #3
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    MasochisticGamer's Avatar
    Join Date
    Nov 2012
    Location
    Gravois Mills. MO USA
    Posts
    76
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes. The formula I'm using is (X - 150) / 20. I've wrapped that in an Int() and Round() function, which SHOULD give me back at least a 1 when X gets to 160 or higher. But it doesn't.

  4. #4
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,051
    Mentioned
    131 Post(s)
    Tagged
    3 Thread(s)
    did you try

    (x-150.0)/20 that should take the division as float and then round using round(), int(), ceiling(), floor()
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  5. #5
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    MasochisticGamer's Avatar
    Join Date
    Nov 2012
    Location
    Gravois Mills. MO USA
    Posts
    76
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fernando View Post
    did you try

    (x-150.0)/20 that should take the division as float and then round using round(), int(), ceiling(), floor()
    This worked like a charm. Thanks!

Similar Threads

  1. how to round to nearest 25
    By rubes in forum Fusion 2.5
    Replies: 3
    Last Post: 3rd September 2014, 11:32 AM
  2. why always integer value when you set global val.?
    By EasySite in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th July 2010, 03:26 PM
  3. Integer to String in C++
    By Dines in forum Extension Development
    Replies: 6
    Last Post: 20th May 2010, 08:40 AM
  4. Integer split
    By James in forum Released Extensions
    Replies: 1
    Last Post: 1st August 2007, 03:45 PM
  5. Non-integer scaling
    By BenMo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 3rd January 2007, 10:54 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
  •