Math.floor are very useful functions. However, when using them, I find myself many times needing to specify a precision level. You don’t always want to round to an integer, you often just want to strip away some of the decimals.
We probably all know that if we have a function to round to integers, we can round to X decimals by doing
Math.pow(10,X). This kind of duck typing can get tedious, so usually, you roll your own function to do that. However, why not just add that extra functionality to the functions that already exist and you’re accustomed to?
KhtmlOpacity) or the IE proprietary
Instead of performing a forwards incompatible browser detect, you can easily check which property is supported with a simple conditional.