Updated to round formatted numbers.

The goal is to avoid very long numbers, such as "190.73486328125M".

Another solution would be to use a function to change the argument of toFixed:
format = function(fixed) { return function(y) { ... (...).toFixed(fixed); }};