Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Round not working...

Round not working...

Scheduled Pinned Locked Moved Help and Support
13 Posts 5 Posters 2.5k Views 2 Watching
  • 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.
  • MurtazaM Murtaza

    I beleive @Hamed is looking into this still. I'll remind him about it tomorrow.

    iTap DevelopmentI Offline
    iTap DevelopmentI Offline
    iTap Development
    wrote on last edited by
    #4

    @Murtaza great, thanks!

    1 Reply Last reply
    0
    • HamedH Offline
      HamedH Offline
      Hamed
      Admin
      wrote on last edited by
      #5

      I think its because you're dividing the number after you're rounding it. Divide first, then round.

      iTap DevelopmentI 1 Reply Last reply
      0
      • HamedH Hamed

        I think its because you're dividing the number after you're rounding it. Divide first, then round.

        iTap DevelopmentI Offline
        iTap DevelopmentI Offline
        iTap Development
        wrote on last edited by
        #6

        @Hamed the reason I'm rounding first, is because I'm trying to round it to 1 decimal place.
        That's why I multiplied by ten, then rounded, then divided by 10.
        For example 10.25*10 = 102.5 round that and you get 103.0 divide that by 10 and get 10.3

        1 Reply Last reply
        0
        • HamedH Offline
          HamedH Offline
          Hamed
          Admin
          wrote on last edited by
          #7

          I think you're going to need another round then. The math behaviours convert the number to a decimal number which is why you're seeing this behaviour.

          Jack de WildeJ iTap DevelopmentI 2 Replies Last reply
          0
          • HamedH Hamed

            I think you're going to need another round then. The math behaviours convert the number to a decimal number which is why you're seeing this behaviour.

            Jack de WildeJ Offline
            Jack de WildeJ Offline
            Jack de Wilde
            wrote on last edited by
            #8

            @Hamed but round(10x)/10 should result in one decimal digit, shouldn't it? I've used round like this before and not had a problem with it.

            1 Reply Last reply
            0
            • HamedH Hamed

              I think you're going to need another round then. The math behaviours convert the number to a decimal number which is why you're seeing this behaviour.

              iTap DevelopmentI Offline
              iTap DevelopmentI Offline
              iTap Development
              wrote on last edited by
              #9

              @Hamed why would dividing by ten give it a decimal...it should just move the decimal place but not give it .999999999 or something, right?

              Aidan_FireA Jack de WildeJ 2 Replies Last reply
              0
              • iTap DevelopmentI iTap Development

                @Hamed why would dividing by ten give it a decimal...it should just move the decimal place but not give it .999999999 or something, right?

                Aidan_FireA Offline
                Aidan_FireA Offline
                Aidan_Fire
                wrote on last edited by
                #10

                @iTap-Development Lol I get this sort of problem too with multiplication/division, get things like .999999999 or .000000001

                1 Reply Last reply
                0
                • iTap DevelopmentI iTap Development

                  @Hamed why would dividing by ten give it a decimal...it should just move the decimal place but not give it .999999999 or something, right?

                  Jack de WildeJ Offline
                  Jack de WildeJ Offline
                  Jack de Wilde
                  wrote on last edited by
                  #11

                  @iTap-Development you could try using the modulus behaviour instead of round, like this:
                  0_1488868223145_IMG_3100.PNG

                  It doesn't use multiplication or division, so you shouldn't get that problem, I don't know how useful this is though if you have to use a lot of round numbers.

                  iTap DevelopmentI 1 Reply Last reply
                  0
                  • Jack de WildeJ Jack de Wilde

                    @iTap-Development you could try using the modulus behaviour instead of round, like this:
                    0_1488868223145_IMG_3100.PNG

                    It doesn't use multiplication or division, so you shouldn't get that problem, I don't know how useful this is though if you have to use a lot of round numbers.

                    iTap DevelopmentI Offline
                    iTap DevelopmentI Offline
                    iTap Development
                    wrote on last edited by
                    #12

                    @Jack8680 yeah I do have to round a lot of numbers, but I could just have the input be an attribute that gets set to the number that needs to be rounded to reuse all the same behaviors.

                    1 Reply Last reply
                    0
                    • iTap DevelopmentI Offline
                      iTap DevelopmentI Offline
                      iTap Development
                      wrote on last edited by
                      #13

                      If anyone is interested, it works to get the text length of the rounded number, and then add 1 to it(since after dividing there's a decimal) and then trimming any decimals off by putting the added value as the end index and having it start from beginning. I guess depending on what you're doing with the rounded number you'll have to add or subtract or whatever from the text length.

                      I think i fixed the decimals in my weather app, but if anyone still has a decimal in it, please let me know!

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Search