The block is even so smart that if you insert a quantity it changes into a Qty-Type (and therefore will only connect to something that expects that) and if you insert something else it will be a Number-Block as before. Note that a variable cannot be detected, so a var would be a âNumberâ.
If you are happy with this idea I can create PR for that.
It looks good to me. I wonder though if the same approach could be leveraged for other Math operations. Other useful operations Iâve seen used:
abs
ceil
floor
max
min
pow
I doubt many are doing trigonometry or logarithmic operations in rules with Quantities but the above (maybe not pow) I can see being useful and Iâve seen them used in the wild.
Yep, could be done but with round I was fortunate that I completely REIMPLEMENTED for OH, so I was able to adapt. Even though it looks like a âstandard blockly blockâ it has been rewritten by me. With all the others you mentioned I need to reimplement them which is probably not a lot of work but not a quick win to be able to add quantity.
Having said that I like the idea. So, if you wouldnât mind, could you open a request for it, so I wonât forget it