hyperPad hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Round a number to two decimal places: HOW?

    Scheduled Pinned Locked Moved
    Help and Support
    2
    16
    314
    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.
    • D
      Deeeds
      last edited by

      I can see how to round a number to integer values, but how to get it to two decimal places?

      Or three decimal places.

      Aidan_FireA 1 Reply Last reply Reply Quote 0
      • Aidan_FireA
        Aidan_Fire @Deeeds
        last edited by

        @Deeeds For 2 decimal places:
        Multiply your value by 100, then round to integer, then divide by 100

        For 3 decimal places:
        Multiply your value by 1000, then round to integer, then divide by 1000

        And so on.

        D 1 Reply Last reply Reply Quote 0
        • D
          Deeeds @Aidan_Fire
          last edited by

          @Aidan-Oxley I was afraid you were going to say this.

          I was hoping you'd say there was a rounding behaviour somewhere odd that I'd overlooked.

          Aidan_FireA 1 Reply Last reply Reply Quote 0
          • Aidan_FireA
            Aidan_Fire @Deeeds
            last edited by

            @Deeeds I’ll go have a look myself, but I’m pretty sure there isn’t any options for that. It’s only 2 extra behaviours though.

            D 1 Reply Last reply Reply Quote 0
            • D
              Deeeds @Aidan_Fire
              last edited by

              @Aidan-Oxley

              3

              Aidan_FireA 1 Reply Last reply Reply Quote 0
              • Aidan_FireA
                Aidan_Fire @Deeeds
                last edited by

                @Deeeds Round on its own would be 1, round with the multiply and divide would be 3. So that’s two extra behaviours.

                D 1 Reply Last reply Reply Quote 0
                • D
                  Deeeds @Aidan_Fire
                  last edited by

                  @Aidan-Oxley Round should be part of a label's functionality so it's possible to work in accuracy and present with less.

                  Aidan_FireA 1 Reply Last reply Reply Quote 0
                  • Aidan_FireA
                    Aidan_Fire @Deeeds
                    last edited by Aidan_Fire

                    @Deeeds Not worth the effort, at least not in my opinion. Changing Round Number behaviour just to be able to round with custom decimals with 2 behaviours less? Not a priority. Maybe they could add it one day.

                    D 2 Replies Last reply Reply Quote 0
                    • D
                      Deeeds @Aidan_Fire
                      last edited by

                      @Aidan-Oxley You keep talking about priority. I don't.

                      I'm talking about ideals of operation and abstraction. When they do it and if they do it is not really any of my business. My commentary is just the opinion of an arsehole.

                      Aidan_FireA 1 Reply Last reply Reply Quote 0
                      • D
                        Deeeds @Aidan_Fire
                        last edited by

                        @Aidan-Oxley While I've got you thinking about ideals rather than prioritising:

                        Labels should also have tracking, and this should be animatable.

                        1 Reply Last reply Reply Quote 0
                        • Aidan_FireA
                          Aidan_Fire @Deeeds
                          last edited by Aidan_Fire

                          @Deeeds 😆 ok 👍. Yeah maybe one day

                          D 2 Replies Last reply Reply Quote 0
                          • D
                            Deeeds @Aidan_Fire
                            last edited by

                            @Aidan-Oxley this is tracking:

                            0_1510879250849_Comp-1_1.gif

                            1 Reply Last reply Reply Quote 0
                            • D
                              Deeeds @Aidan_Fire
                              last edited by

                              @Aidan-Oxley Sorry. Spelt your name wrong... DOH!

                              Aidan_FireA 1 Reply Last reply Reply Quote 0
                              • Aidan_FireA
                                Aidan_Fire @Deeeds
                                last edited by

                                @Deeeds Lol everyone spells my name like that. Looks interesting, but looks like it might be pretty hard for devs to code in.

                                D 1 Reply Last reply Reply Quote 0
                                • D
                                  Deeeds @Aidan_Fire
                                  last edited by

                                  @Aidan-Oxley No. Tracking is a value of Labels. It's the space between letters. Very common element of fonts. BMFonts even support kerning pairs.

                                  Aidan_FireA 1 Reply Last reply Reply Quote 0
                                  • Aidan_FireA
                                    Aidan_Fire @Deeeds
                                    last edited by

                                    @Deeeds Ohhh I see. So being able to change space between letters in a label. Not a bad idea.

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