A JavaScript implementation of PHP's number_format.