Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/pkg/angular/lib/filter/number.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/pkg/angular/lib/filter/module.dart ('k') | third_party/pkg/angular/lib/filter/order_by.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/lib/filter/number.dart
diff --git a/third_party/pkg/angular/lib/formatter/number.dart b/third_party/pkg/angular/lib/filter/number.dart
similarity index 69%
rename from third_party/pkg/angular/lib/formatter/number.dart
rename to third_party/pkg/angular/lib/filter/number.dart
index 1cb2514b6b49aae9bfc93fe5bf8c3c1f153bf5d9..469bb6f39227275ea4a3519425b4b31bf2e7bba9 100644
--- a/third_party/pkg/angular/lib/formatter/number.dart
+++ b/third_party/pkg/angular/lib/filter/number.dart
@@ -1,4 +1,4 @@
-part of angular.formatter_internal;
+part of angular.filter;
/**
* Formats a number as text.
@@ -11,10 +11,10 @@ part of angular.formatter_internal;
* {{ number_expression | number[:fractionSize] }}
*
*/
-@Formatter(name:'number')
-class Number {
+@NgFilter(name:'number')
+class NumberFilter {
- var _nfs = new Map<String, Map<num, NumberFormat>>();
+ Map<num, NumberFormat> nfs = new Map<num, NumberFormat>();
/**
* [value]: the value to format
@@ -28,16 +28,14 @@ class Number {
if (value is String) value = double.parse(value);
if (!(value is num)) return value;
if (value.isNaN) return '';
- var verifiedLocale = Intl.verifiedLocale(Intl.getCurrentLocale(), NumberFormat.localeExists);
- _nfs.putIfAbsent(verifiedLocale, () => new Map<num, NumberFormat>());
- var nf = _nfs[verifiedLocale][fractionSize];
+ var nf = nfs[fractionSize];
if (nf == null) {
nf = new NumberFormat()..maximumIntegerDigits = 9;
if (fractionSize != null) {
nf.minimumFractionDigits = fractionSize;
nf.maximumFractionDigits = fractionSize;
}
- _nfs[verifiedLocale][fractionSize] = nf;
+ nfs[fractionSize] = nf;
}
return nf.format(value);
}
« no previous file with comments | « third_party/pkg/angular/lib/filter/module.dart ('k') | third_party/pkg/angular/lib/filter/order_by.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698