User Tag List

Results 1 to 4 of 4

Thread: Combined Ceil() Floor() function

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Combined Ceil() Floor() function

    Hi
    I have a value ( float/ decimal ) that range from -9999 to +9999.
    When the value is negative, i want to return the ceil() value of the value.
    When the value is positive, i want to return the floor() value of the value.

    Would it be possible, somehow, to do this in a single event or expression?

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    int()

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks MuddyMole!
    The answer was that simple huh

    However, i seem to have explained myself wrongly

    Example:

    +2,6 should become 2

    -2,6 should become -2

    Would it be possible, somehow, to do this in a single event or expression?
    EDIT: Seems this is what INT does when i think about it...

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    The easiest way to think about it:

    Ceil() always rounds up
    Floor() always rounds down
    Int() rounds towards zero (ie. up if the value is negative; down if it's positive)
    Round() rounds towards the nearest integer

Similar Threads

  1. combined objects
    By Bogeyman in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 12th September 2012, 04:17 PM
  2. [Bug] Floor / Ceil displays decimals
    By Popcorn in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 20th August 2012, 06:15 PM
  3. ceil, floor probleme
    By graboide in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 14th December 2010, 05:41 PM
  4. Using a mouse, combined with scrolling?
    By JohnBarnard in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 9th March 2009, 04:39 PM
  5. Two Strings Combined?
    By Pxl_Buzzard in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 10th November 2006, 02:12 AM

Posting Permissions

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