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

Unified Diff: pkg/intl/number_format.dart

Issue 10829459: Deprecate Math object in corelib in favor of dart:math library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 4 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 | « pkg/intl/lib/date_format_helpers.dart ('k') | pkg/unittest/interactive_html_config.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/number_format.dart
diff --git a/pkg/intl/number_format.dart b/pkg/intl/number_format.dart
index ddbd9c289b54f64c030550fe3678100be4556e16..35569a012cde6ef994228bb5c9426e571244146a 100644
--- a/pkg/intl/number_format.dart
+++ b/pkg/intl/number_format.dart
@@ -4,6 +4,8 @@
#library("number_format");
+#import('dart:math');
+
#import("intl.dart");
#import("number_symbols.dart");
#import("number_symbols_data.dart");
@@ -111,15 +113,15 @@ class NumberFormat {
return;
}
- var exponent = (Math.log(number) / Math.log(10)).floor();
- var mantissa = number / Math.pow(10, exponent);
+ var exponent = (log(number) / log(10)).floor();
+ var mantissa = number / pow(10, exponent);
if (_minimumIntegerDigits < 1) {
exponent++;
mantissa /= 10;
} else {
exponent -= _minimumIntegerDigits - 1;
- mantissa *= Math.pow(10, _minimumIntegerDigits - 1);
+ mantissa *= pow(10, _minimumIntegerDigits - 1);
}
_formatFixed(number);
_formatExponent(exponent);
@@ -144,7 +146,7 @@ class NumberFormat {
*/
void _formatFixed(num number) {
// Round the number.
- var power = Math.pow(10, _maximumFractionDigits);
+ var power = pow(10, _maximumFractionDigits);
var intValue = number.truncate().toInt();
var multiplied = (number * power).round();
var fracValue = (multiplied - intValue * power).floor().toInt();
« no previous file with comments | « pkg/intl/lib/date_format_helpers.dart ('k') | pkg/unittest/interactive_html_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698