Number formatter for JavaScript