Navigation

    CreatiCode Scratch Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    New block: Round by {number}

    Feedback
    4
    9
    897
    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.
    • 白刃の亡霊
      白刃の亡霊 Best Forum Helpers last edited by

      There’s a slight annoyance with the round block: It only rounds to the nearest ones place. What if instead of just that, you can choose from any digit (a few, for example, would be the hundredth, tenth, ones, or any decimal point place).

      This block would be a typing output and not a clicking output so they can choose any digit place to round up/down to.

      Ghost of the White Blade

      info-creaticode 1 Reply Last reply Reply Quote 0
      • Tyller_
        Tyller_ Best Forum Helpers last edited by

        @the_true_odst you can do this already in a simple way. Multiply the number 10 to the number of places you want (so for 3 places 10^3 or 1000), round it, then divide by that number

        For example, to round the variable “money” to the 2nd decimal: round( money * 100) / 100

        <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
        </div>

        白刃の亡霊 Attractive Milk 2 Replies Last reply Reply Quote 0
        • 白刃の亡霊
          白刃の亡霊 Best Forum Helpers @Tyller_ last edited by

          @tyller_ It would be simpler though

          Ghost of the White Blade

          Tyller_ 1 Reply Last reply Reply Quote 0
          • Attractive Milk
            Rhyder Byrd @Tyller_ last edited by

            @tyller_ it would be a lot easier

            Tyller_ 1 Reply Last reply Reply Quote 0
            • info-creaticode
              CreatiCode @白刃の亡霊 last edited by

              Yes. And another issue is that the round block is from the original MIT Scratch, and we try to keep those blocks unchanged for compatibility.

              白刃の亡霊 1 Reply Last reply Reply Quote 0
              • 白刃の亡霊
                白刃の亡霊 Best Forum Helpers @info-creaticode last edited by

                @info-creaticode What about a new block?

                Ghost of the White Blade

                info-creaticode 1 Reply Last reply Reply Quote 0
                • Tyller_
                  Tyller_ Best Forum Helpers @白刃の亡霊 last edited by

                  @the_true_odst well that method is already pretty simple, plus you could make a custom block to do it

                  <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                  </div>

                  1 Reply Last reply Reply Quote 0
                  • Tyller_
                    Tyller_ Best Forum Helpers @Attractive Milk last edited by

                    @attractive-milk well this one is already easy, I just suck at explaining stuff in simple ways

                    <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                    </div>

                    1 Reply Last reply Reply Quote 0
                    • info-creaticode
                      CreatiCode @白刃の亡霊 last edited by

                      @the_true_odst said in New block: Round by {number}:

                      What about a new block?

                      Well, it will be a bit confusing with 2 “round” blocks. Also, as shown, it is fairly easy to work around it, right?

                      d4dae5fa-1610-4f0c-8835-f3cd3c7069af-image.png

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