aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKury Kruitbosch2013-02-11 14:21:15 -0700
committerIgor Minar2013-02-14 13:15:50 -0800
commitf5835963d5982003a713dd354eefd376ed39ac02 (patch)
treeff4e960e1cc5dd9b291549b6a6005e212e04cf46 /src
parentf3231b944707f5984fc87a3ff34854b3f7630977 (diff)
downloadangular.js-f5835963d5982003a713dd354eefd376ed39ac02.tar.bz2
fix(numberFilter): fix formatting when "0" passed as fractionSize
When checking to add decimal and trialing 0s number filter used to check trueness of fractionSize. "0" evaluating to true causes "123" to return "123."
Diffstat (limited to 'src')
-rw-r--r--src/ng/filter/filters.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js
index 4680a306..0b4a2e91 100644
--- a/src/ng/filter/filters.js
+++ b/src/ng/filter/filters.js
@@ -168,7 +168,7 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
fraction += '0';
}
- if (fractionSize) formatedText += decimalSep + fraction.substr(0, fractionSize);
+ if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize);
}
parts.push(isNegative ? pattern.negPre : pattern.posPre);