{"ScriptPreparationCode":null,"TestCases":[{"Name":"Intl","Code":"new Intl.NumberFormat(\u0027en-US\u0027, {\r\n style: \u0027decimal\u0027,\r\n useGrouping: true,\r\n minimumFractionDigits: 0,\r\n maximumFractionDigits: 3,\r\n }).format(\u0027100000.234\u0027)","IsDeferred":false},{"Name":"String","Code":"const value = \u0027100000.234\u0027;\r\n\r\nfunction decimalFormat(value) {\r\n\r\n // fix for rounding issues, see Mozilla docs on method toFixed()\r\n const normalizedValue = value * 10 ** 3;\r\n const formattedValue = normalizedValue.toFixed(0);\r\n return \u002BformattedValue / 10 ** 3;\r\n}\r\n\r\nfunction formatThousandsSeparator(value) {\r\n // TODO: consider replacing this later with Intl.NumberFormat\r\n const parts = value.toString().split(\u0027.\u0027);\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})\u002B(?!\\d))/g, \u0027,\u0027);\r\n return parts.join(\u0027.\u0027);\r\n}\r\n\r\ndecimalFormat(formatThousandsSeparator(value))","IsDeferred":false}]}