{"ScriptPreparationCode":"function round2(num, places) {\r\n return \u002B(Math.round(num \u002B \u0022e\u002B\u0022 \u002B places) \u002B \u0022e-\u0022 \u002B places);\r\n}\r\n\r\nfunction round3(num, places) {\r\n if (places === 2) { \r\n return Math.round( Math.round( num * 1000 ) / 10 ) / 100\r\n } else {\r\n const multiplier = Math.pow(10, places)\r\n \treturn Math.round(num * multiplier) / multiplier\r\n }\r\n}\r\n\r\nfunction round4(num, places) {\r\n \u002B(num.toLocaleString(\r\n \u0027en\u0027, \r\n { maximumFractionDigits: places, useGrouping: false }\r\n ))\r\n}","TestCases":[{"Name":"Simple rounding","Code":"Math.round(12.345 * 100) / 100","IsDeferred":false},{"Name":"Rounding with epsilon and string conversion","Code":"round2(12.345, 2)","IsDeferred":false},{"Name":"Rounding with \u0022if\u0022 statement","Code":"round3(12.345, 2)","IsDeferred":false},{"Name":"Rounding by toLocaleString","Code":"round4(12.345, 2)","IsDeferred":false}]}