{"ScriptPreparationCode":"function fixRoundingError (num) {\r\n return \u002Bnum.toPrecision(15);\r\n};\r\n\r\n\r\nfunction roundToNearestFloat (num, roundingFactor, roundMode) {\r\n const remainder = fixRoundingError(num % roundingFactor);\r\n if (remainder === 0) {\r\n return num;\r\n }\r\n\r\n if (roundMode === \u0027up\u0027) {\r\n return fixRoundingError(num \u002B (roundingFactor - remainder));\r\n }\r\n if (roundMode === \u0027down\u0027) {\r\n return fixRoundingError(num - remainder);\r\n }\r\n \r\n throw new Error(\u0027Invalid roundMode.\u0027);\r\n};","TestCases":[{"Name":"C1","Code":"new BigNumber(12345678.12345678).toFixed(8)","IsDeferred":false},{"Name":"S1","Code":"_.floor(12345678.12345678, 8)","IsDeferred":false},{"Name":"K1","Code":"roundToNearestFloat(12345678.12345678, 0.00000001, \u0027down\u0027)","IsDeferred":false}]}