{"ScriptPreparationCode":"var myFloat = 210.758375837345;\r\nvar negFloat = -15.8674937593462;\r\nvar pos = 0.0, neg = 0.0, posi = 0, negi = 0;","TestCases":[{"Name":"myFloat.toFixed(2) ","Code":"pos = myFloat.toFixed(2);\r\nneg = negFloat.toFixed(2);","IsDeferred":false},{"Name":"myFloat.toPrecision(2) ","Code":"pos = myFloat.toPrecision(2);\r\nneg = negFloat.toPrecision(2);","IsDeferred":false},{"Name":"Math.round(myFloat*100.0)/100.0 ","Code":"pos = Math.round(myFloat*100.0)/100.0;\r\nneg = Math.round(negFloat*100.0)/100.0;","IsDeferred":false},{"Name":"Bitwise: signed round \u00B1 to 2 places ","Code":"pos = (100.0*(myFloat \u003C 0.0 ? myFloat - 0.005 : myFloat \u002B 0.005) \u003E\u003E 0)/100.0;\r\nneg = (100.0*(negFloat \u003C 0.0 ? negFloat - 0.005 : negFloat \u002B 0.005) \u003E\u003E 0)/100.0;","IsDeferred":false},{"Name":"Bitwise: UNsigned round \u00B1 to 2 places ","Code":"pos = (100.0*myFloat\u002B0.5 \u003E\u003E 0)/100.0;\r\nneg = (100.0*negFloat-0.5 \u003E\u003E 0)/100.0;","IsDeferred":false},{"Name":"myFloat.toFixed(0) ","Code":"posi = myFloat.toFixed(0);\r\nnegi = negFloat.toFixed(0);","IsDeferred":false},{"Name":"Math.round()","Code":"posi = Math.round(myFloat);\r\nnegi = Math.round(negFloat);","IsDeferred":false},{"Name":"Bitwise: signed round \u00B1 to int","Code":"posi = (myFloat \u003C 0.0 ? myFloat - 0.5 : myFloat \u002B 0.5) \u003E\u003E 0;\r\nnegi = (negFloat \u003C 0.0 ? negFloat - 0.5 : negFloat \u002B 0.5) \u003E\u003E 0;","IsDeferred":false},{"Name":"Bitwise: UNsigned round \u00B1 to int","Code":"posi = myFloat\u002B0.5 \u003E\u003E 0;\r\nnegi = negFloat-0.5 \u003E\u003E 0;","IsDeferred":false},{"Name":"Math.floor() round down","Code":"posi = Math.floor(myFloat);\r\nnegi = Math.floor(negFloat);","IsDeferred":false},{"Name":"Math.trunc() round toward zero","Code":"posi = Math.trunc(myFloat);\r\nnegi = Math.trunc(negFloat);","IsDeferred":false},{"Name":"Bitwise: round toward zero","Code":"posi = myFloat | 0;\r\nnegi = negFloat | 0;","IsDeferred":false}]}