Discuss Scratch
- Discussion Forums
- » Suggestions
- » "Percentage Between" Operators Block
- Toodchop
-
100+ posts
"Percentage Between" Operators Block
Note: If you’d like, feel free to reply with what you think the benefits of this block could be, or how you might use it in your projects!
Hello! I have a suggestion for a new operators block that could be really helpful for math-based projects. The idea is a “percentage between” block that calculates the percentage of the distance between two numbers. Here's how it would work:
The block would look like this:
For example,
This block would simplify the process of calculating midpoints and percentages without needing to manually use formulas like:
Example use:
It would be a great tool for anyone working with animations, game mechanics, or even math lessons. Let me know what you think!
Hello! I have a suggestion for a new operators block that could be really helpful for math-based projects. The idea is a “percentage between” block that calculates the percentage of the distance between two numbers. Here's how it would work:
The block would look like this:
(50) % between (1) and (5) :: operators reporter
For example,
(50) % between (1) and (5) :: operators reporter : // would return 3 (the midpoint).
(25) % between (1) and (5) :: operators reporter : // would return 2 (a quarter of the way).
This block would simplify the process of calculating midpoints and percentages without needing to manually use formulas like:
(((x) + (y)) / (2))
Example use:
when green flag clicked
forever
go to ((50) % between ([x position v] of (red ball v)) and ([x position v] of (blue ball v)) :: operators)
end
It would be a great tool for anyone working with animations, game mechanics, or even math lessons. Let me know what you think!
Last edited by Toodchop (Oct. 9, 2025 09:43:50)
- jmdzti_0-0
-
1000+ posts
"Percentage Between" Operators Block
You don’t need different formulae for each percentage:

Last edited by jmdzti_0-0 (Aug. 8, 2025 10:25:36)
- Toodchop
-
100+ posts
"Percentage Between" Operators Block
Oh, I didn't know that! You don’t need different formulae for each percentage:
- jmdzti_0-0
-
1000+ posts
"Percentage Between" Operators Block
also: 25% of (1+5) is 1.5, not 2.
- aaliyaan0110
-
500+ posts
"Percentage Between" Operators Block
i think that would be used for gambl games, no support
Last edited by aaliyaan0110 (Aug. 8, 2025 10:54:18)
- jmdzti_0-0
-
1000+ posts
"Percentage Between" Operators Block
well, the i think that would be used for gambl games, no support
(pick random (0) to (10))block can also be used to make gambling games and it’s still there as far as i know. don’t bring up ridiculous arguments to not support.
anyways, i think gambling games ARE allowed on scratch as long as they don’t involve real money and whatnot (* i am using that word way too much today). you can’t monetize projects on scratch at all
Last edited by jmdzti_0-0 (Aug. 8, 2025 18:01:55)
- Toodchop
-
100+ posts
"Percentage Between" Operators Block
This block calculates a given percentage of the range between two numbers, not their sum. also: 25% of (1+5) is 1.5, not 2.
Last edited by Toodchop (Aug. 9, 2025 02:01:21)
- Toodchop
-
100+ posts
"Percentage Between" Operators Block
This block calculates a given percentage of the range between two numbers, not calculate a chance. i think that would be used for gambl games, no support
- Quantum-Cat
-
1000+ posts
"Percentage Between" Operators Block
In programming, this operation is usually called lerp (linear interpolation), and the formula is a + (b-a) * percentage/100 (or instead of percentage/100, a parameter t that goes between 0 and 1.0). I think it was suggested a few times before, but I honestly think your phrasing of the block is more beginner-friendly.
- jmdzti_0-0
-
1000+ posts
"Percentage Between" Operators Block
ignore this post
Last edited by jmdzti_0-0 (Sept. 6, 2025 21:54:08)
- medians
-
1000+ posts
"Percentage Between" Operators Block
With the formula given in that post, you cannot do that. You have to follow order of operationslinear interpolation), and the formula is a + (b-a) * percentage/100 (or instead of percentage/100, a parameter t that goes between 0 and 1.0). I think it was suggested a few times before, but I honestly think your phrasing of the block is more beginner-friendly.a + (b-a) is just b In programming, this operation is usually called lerp (
- ispretty
-
500+ posts
"Percentage Between" Operators Block
you're not accounting for the order of operations, it's a + ((b-a) * percentage/100) (which you can't simplify further)linear interpolation), and the formula is a + (b-a) * percentage/100 (or instead of percentage/100, a parameter t that goes between 0 and 1.0). I think it was suggested a few times before, but I honestly think your phrasing of the block is more beginner-friendly.a + (b-a) is just b In programming, this operation is usually called lerp (
- aaliyaan0110
-
500+ posts
"Percentage Between" Operators Block
how is everybody good at math 

- Toodchop
-
100+ posts
"Percentage Between" Operators Block
I hope the block is NOT too complex for Scratch. how is everybody good at math
- Za-Chary
-
1000+ posts
"Percentage Between" Operators Block
Just curious, what are some practical uses for this block? In particular, you mention animations and game mechanics, but what specifically can this block be used for in those instances?
- Discussion Forums
- » Suggestions
-
» "Percentage Between" Operators Block