{"ScriptPreparationCode":"function newFormatNumber(value, decimals, decimalSeparator = \u0027,\u0027, thousandsSeparator = \u0027.\u0027, prefix = \u0027\u0027, suffix = \u0027\u0027) {\r\n \t\tif (value === null || isNaN(value)) return value;\r\n \r\n let negative = value \u003C 0 ? \u0027-\u0027 : \u0027\u0027;\r\n let absValue = Math.abs(value);\r\n let integerPart = Math.floor(absValue);\r\n let decimalPart = absValue - integerPart;\r\n let formattedIntegerPart = integerPart.toString().replace(/\\B(?=(\\d{3})\u002B(?!\\d))/g, thousandsSeparator);\r\n let formattedDecimalPart = decimalPart.toFixed(decimals).slice(2);\r\n \r\n return \u0060${prefix}${negative}${formattedIntegerPart}${decimalSeparator}${formattedDecimalPart}${suffix}\u0060;\r\n }\r\n \r\n function oldFormatNumber(value, options = {}) {\r\n if (value === null || isNaN(value)) return value;\r\n\r\n let standardOptions = {\r\n minimumFractionDigits: (typeof options.minimumFractionDigits === \u0022number\u0022 ? options.minimumFractionDigits : null )\r\n || (typeof options.fractionDigits === \u0022number\u0022 ? options.fractionDigits : 2),\r\n maximumFractionDigits: (typeof options.maximumFractionDigits === \u0022number\u0022 ? options.maximumFractionDigits : null )\r\n || (typeof options.fractionDigits === \u0022number\u0022 ? options.fractionDigits : 2),\r\n }\r\n \r\n return (value * 1).toLocaleString(\u0027ro\u0027, standardOptions);\r\n }","TestCases":[{"Name":"OldFormatNumber","Code":"let num = oldFormatNumber(-123456.7890123, {fractionDigits: 2});","IsDeferred":false},{"Name":"NewFormatNumber","Code":"let num = newFormatNumber(-123456.7890123, 2, \u0027,\u0027, \u0027.\u0027, \u0027\u0027, \u0027 EUR\u0027);","IsDeferred":false},{"Name":"FormatNumber for NaN (both)","Code":"let num = oldFormatNumber(\u0027abc\u0027, {fractionDigits: 2});","IsDeferred":false}]}