{"ScriptPreparationCode":"function formatUSD(a) {\r\n\tconst [str, fraction] = String(a).split(\u0027.\u0027);\r\n\treturn \u0027$\u0027 \u002B str.split(\u0027\u0027).reverse().join(\u0027\u0027).match(/\\d{1,3}/g).join().split(\u0027\u0027).reverse().join(\u0027\u0027) \u002B \u0027.\u0027 \u002B fraction;\r\n}\r\n\r\nvar formatIntlUSD = new Intl.NumberFormat(\u0022en-US\u0022, { style: \u0027currency\u0027, currency: \u0027USD\u0027 });","TestCases":[{"Name":"Intl.NumberFormat","Code":"var a = new Intl.NumberFormat(\u0022en-US\u0022, { style: \u0027currency\u0027, currency: \u0027USD\u0027 }).format(10000.56);","IsDeferred":false},{"Name":"toLocalString","Code":"var a = (10000.56).toLocaleString(\u0022en-US\u0022, { style: \u0027currency\u0027, currency: \u0027USD\u0027 });","IsDeferred":false},{"Name":"Custom Formatter","Code":"var a = formatUSD(10000.56);","IsDeferred":false},{"Name":"Pre-created Intl formatter","Code":"var a = formatIntlUSD.format(10000.56);","IsDeferred":false}]}