Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Rounding up numbers

    Beginners
    4
    6
    230
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AndyG1985
      AndyG1985 last edited by

      Hi everyone, is there a way to check if a value is not a whole number and if so to round up?

      I basically have a strange issue with Dizzy’s Y position returning -0.44 when jumping up a step underwater facing forwards, but not when facing sideways - odd, and barely noticeable but it bugs me!

      1 Reply Last reply Reply Quote 0
      • Gameboy
        Gameboy F last edited by

        Is this helpful? https://fuzearena.com/help/view/round

        1 Reply Last reply Reply Quote 1
        • pianofire
          pianofire Fuze Team last edited by

          That will round up or down to the nearest whole number. Do you always want to round up?

          1 Reply Last reply Reply Quote 1
          • vinicity
            vinicity F last edited by vinicity

            Ceil() rounds up!

            https://fuzearena.com/help/view/ceil

            1 Reply Last reply Reply Quote 1
            • vinicity
              vinicity F last edited by

              To check if it is a whole number you can compare the original number with the rounded value. If they are the same, then the number was whole to start with.

              1 Reply Last reply Reply Quote 1
              • AndyG1985
                AndyG1985 last edited by AndyG1985

                dizzy.y = ceil (dizzy.y)

                So simple! Thanks a lot everyone 😄
                And yes pianofire - for now I just need it rounded up. It’s all useful knowledge anyway!

                1 Reply Last reply Reply Quote 3
                • First post
                  Last post