{"ScriptPreparationCode":"function pricize (num, decimal = 0) {\r\n const intPart = Math.floor(num)\r\n const intPieces = intPart.toString().split(\u0027\u0027)\r\n const len = intPieces.length\r\n const intStr = intPieces.reduce((result, chr, index, array) =\u003E {\r\n const pos = len - index\r\n result \u002B= (index !== 0 \u0026\u0026 pos % 3 === 0) ? \u0027,\u0027 \u002B chr : chr\r\n return result\r\n }, \u0027\u0027)\r\n\r\n const decStr = decimal \u003E 0\r\n ? num.toFixed(decimal \u002B 1).toString().slice(-(decimal \u002B 2), -1) // toFixed() \u306F\u56DB\u6368\u4E94\u5165\u3057\u3066\u3057\u307E\u3046\u306E\u3067(decimal \u002B 1)\u6841\u307E\u3067\u6C42\u3081\u3066\u5207\u308A\u53D6\u308B\r\n : \u0027\u0027\r\n\r\n return intStr \u002B decStr\r\n}\r\n\r\nvar target = 123456789.123456789\r\nvar options = {minimumFractionDigits: 3, maximumFractionDigits: 3}","TestCases":[{"Name":"toLocaleString","Code":"var a = target.toLocaleString(\u0027en-US\u0027, options);","IsDeferred":false},{"Name":"Intl.NumberFormat","Code":" var a = new Intl.NumberFormat(\u0027en-US\u0027, options).format(target)","IsDeferred":false},{"Name":"string split \u0026 reduce","Code":"var a = pricize(target, 3)","IsDeferred":false}]}