HISE Logo Forum
    • Categories
    • Register
    • Login

    Faking A LAF Slider To Show Percent Instead Of Actual Value?!

    Scheduled Pinned Locked Moved Scripting
    13 Posts 3 Posters 387 Views
    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.
    • ?
      A Former User @Natan
      last edited by

      @natan I believe

      g.drawAlignedText(obj.valueNormalized * 100 + "%", obj.area, "centred");
      

      Might be what you're looking for :)

      NatanN 2 Replies Last reply Reply Quote 3
      • d.healeyD
        d.healey @Natan
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • NatanN
          Natan @A Former User
          last edited by

          @iamlamprey Excellent, Thanks a lot, Will it give a try Now

          1 Reply Last reply Reply Quote 0
          • NatanN
            Natan @A Former User
            last edited by

            @iamlamprey said in Faking A LAF Slider To Show Percent Instead Of Actual Value?!:

            g.drawAlignedText(obj.valueNormalized * 100 + "%", obj.area, "centred");

            Thanks Lam.
            I Guess It need to Be Rounded, It Shows A Strange Number 21.4765%

            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @Natan
              last edited by

              @natan Engine.doubleToString()

              NatanN 1 Reply Last reply Reply Quote 1
              • NatanN
                Natan @d.healey
                last edited by

                @d-healey said in Faking A LAF Slider To Show Percent Instead Of Actual Value?!:

                Engine.doubleToString()

                Thank you sir, How to Add this to The Code?

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @Natan
                  last edited by

                  @natan Try it and see if you can work it out.

                  cf3f4b4b-0fdd-4be1-af40-91c869dcf6a7-image.png

                  1 Reply Last reply Reply Quote 0
                  • NatanN
                    Natan
                    last edited by Natan

                    @d-healey @iamlamprey Thank you Guys
                    I Found the Answer

                    g.drawAlignedText(parseInt(obj.valueNormalized * 100) + "%", obj.area, "centred");
                    

                    I Remember That I Did this Mounths Ago, Once i switched to Develop Branch,
                    This Rounds The Numbers :)

                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @Natan
                      last edited by

                      @natan parseInt won't always work the way you expect - but in this case it's fine.

                      NatanN 1 Reply Last reply Reply Quote 1
                      • NatanN
                        Natan @d.healey
                        last edited by

                        @d-healey I Just Need The Numbers to Be In Percent, Nothing Fancy
                        Thank you Sir for Info <3 :folded_hands:

                        ? 1 Reply Last reply Reply Quote 0
                        • ?
                          A Former User @Natan
                          last edited by

                          @natan You can also use Math.round(), not sure which is the most efficient

                          NatanN 1 Reply Last reply Reply Quote 1
                          • NatanN
                            Natan @A Former User
                            last edited by

                            @iamlamprey Yeah I'll Check and See if That Works Or Not.
                            BTW This one works Just Fine
                            g.drawAlignedText(parseInt(obj.valueNormalized * 100) + "%", obj.area, "centred");

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

                            49

                            Online

                            1.7k

                            Users

                            11.7k

                            Topics

                            102.2k

                            Posts