{"ScriptPreparationCode":"const input = {\r\n price: \u00271234.567890\u0027\r\n};\r\nconst locale = \u0027en-US\u0027;\r\nconst options = {\r\n style: \u0027currency\u0027,\r\n currency: \u0027USD\u0027\r\n};\r\n\r\nwindow.benchmarkConfig = {\r\n input,\r\n locale,\r\n options\r\n}","TestCases":[{"Name":"OOP","Code":"class BaseFormatter {\r\n constructor(locale) {\r\n this.locale = locale;\r\n }\r\n\r\n formatPrice(input, options) {\r\n const rawValue = parseFloat(input);\r\n const formatter = new Intl.NumberFormat(this.locale, options);\r\n return formatter.format(rawValue);\r\n }\r\n}\r\n\r\nclass OrderBookFormatter extends BaseFormatter {\r\n format(input) {\r\n return {\r\n price: this.formatPrice(input.price, window.benchmarkConfig.options),\r\n };\r\n }\r\n}\r\n\r\nconst oopFormatter = new OrderBookFormatter(window.benchmarkConfig.locale);\r\n\r\noopFormatter.format(window.benchmarkConfig.input)","IsDeferred":false},{"Name":"FP","Code":"const formatPrice = (input, { locale, options }) =\u003E {\r\n const rawValue = parseFloat(input);\r\n const formatter = new Intl.NumberFormat(locale, options);\r\n return formatter.format(rawValue);\r\n};\r\n\r\nconst createOrderBookFormatter = (locale) =\u003E {\r\n return (input) =\u003E {\r\n return {\r\n price: formatPrice(input.price, { locale, options: window.benchmarkConfig.options }),\r\n };\r\n };\r\n};\r\n\r\nconst fpFormatter = createOrderBookFormatter(window.benchmarkConfig.locale);\r\n\r\nfpFormatter(window.benchmarkConfig.input)","IsDeferred":false}]}