NodeJS
npm i number_format-php --save
Web
<script src="number-format.js"></script>
NodeJS
var number_format = require("number_format-php");
number_format(1234567.125, 2, ".", " "); // 1 234 567.13
Web
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
});