let v = 0
min( max( v, 0), 5)
if v <= 0 { v = 0 }
else
if v >= 5 { v = 5 }
v <= 0 ? 0 : (v >= 5 ? 5 : (v))
Created
August 17, 2019 06:46
-
-
Save islandjoe/bbf44ffda647bb557a4181718a505a66 to your computer and use it in GitHub Desktop.
Clamp value to between 0 and 5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment