number_format-php
Version:
Ported PHP function 'number_format' in JavsScript
34 lines (28 loc) • 985 B
Markdown
## Ported PHP function "number_format" in JavaScript
[](https://travis-ci.com/github/tasofen/number_format-node)
[](https://www.npmjs.com/package/number_format-php)
[](https://www.npmjs.com/package/number_format-php)
[](https://www.npmjs.com/package/number_format-php)
## Install
NodeJS
```bash
npm i number_format-php --save
```
Web
```html
<script src="number-format.js"></script>
```
## Usage
NodeJS
```js
var number_format = require("number_format-php");
number_format(1234567.125, 2, ".", " "); // 1 234 567.13
```
Web
```js
number_format(1234567.125, 2, ".", " "); // 1 234 567.13
// AMD
requirejs(["helper/number_format"], function(number_format) {
number_format(1234567.125, 2, ".", " "); // 1 234 567.13
});
```