From 0ff7ed2705580921d581bf5f32793d4f3e699f5b Mon Sep 17 00:00:00 2001 From: MoNam97 Date: Fri, 24 Dec 2021 22:27:04 +0330 Subject: [PATCH 1/2] #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)) + '}$'); From 6e3cdcfb305bd06c729e2e04638c947e7b8e4dfc Mon Sep 17 00:00:00 2001 From: MoNam97 Date: Fri, 4 Feb 2022 20:10:14 +0330 Subject: [PATCH 2/2] this fixes issue #449 --- numeral.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/numeral.js b/numeral.js index 4350bba1..3aed2ce4 100644 --- a/numeral.js +++ b/numeral.js @@ -278,6 +278,8 @@ value = 0; } else if (options.nullFormat && string === options.nullFormat || !string.replace(/[^0-9]+/g, '').length) { value = null; + }else if (string.match("[0-9]+[a-zA-Z@!&$#]+[0-9]+")) { + value = null; } else { value = 1;