Beware strange behaviour if number is negative and precision is bigger than the actual number of digits after comma.
round(-0.07, 4);
returns
-0.07000000000000001
So if you validate it against a regular expression requiring the maximum amount of digits after comma, you'll get into trouble.