in reply to Optimize Percentage validation
The code becomes more complex in the cases I tried and you don't gain much (±5% using Benchmark).
I tried a variation using substr to check the decimal place length and split after checking that the number was between 0 and 100.
It just makes it unecessarily complicated, and the code runs very quickly as it is.