From 0ff7ed2705580921d581bf5f32793d4f3e699f5b Mon Sep 17 00:00:00 2001 From: MoNam97 Date: Fri, 24 Dec 2021 22:27:04 +0330 Subject: [PATCH] #515 Solved --- numeral.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numeral.js b/numeral.js index 22726c9e..4350bba1 100644 --- a/numeral.js +++ b/numeral.js @@ -395,7 +395,7 @@ power = Math.pow(10, boundedPrecision); // Multiply up by precision, round accurately, then divide and use native toFixed(): - output = (roundingFunction(value + 'e+' + boundedPrecision) / power).toFixed(boundedPrecision); + output = (roundingFunction((value + 'e+' + boundedPrecision) -0.5)/ power).toFixed(boundedPrecision); if (optionals > maxDecimals - boundedPrecision) { optionalsRegExp = new RegExp('\\.?0{1,' + (optionals - (maxDecimals - boundedPrecision)) + '}$');