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

Unified Diff: pkg/intl/lib/number_format.dart

Issue 12317107: ceil/floor/truncate/round return integers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload due to error3 Created 7 years, 9 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/fixnum/test/int_64_vm_test.dart ('k') | pkg/intl/lib/src/date_format_field.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/number_format.dart
diff --git a/pkg/intl/lib/number_format.dart b/pkg/intl/lib/number_format.dart
index 567fb99946a7757c6bb857d5c2f739a168ee8844..ed5cf2be23653d36cd506c4fbb3adf35f60a4f4d 100644
--- a/pkg/intl/lib/number_format.dart
+++ b/pkg/intl/lib/number_format.dart
@@ -156,9 +156,9 @@ class NumberFormat {
void _formatFixed(num number) {
// Round the number.
var power = pow(10, _maximumFractionDigits);
- var intValue = number.truncate().toInt();
+ var intValue = number.truncate();
var multiplied = (number * power).round();
- var fracValue = (multiplied - intValue * power).floor().toInt();
+ var fracValue = (multiplied - intValue * power).floor();
var fractionPresent = _minimumFractionDigits > 0 || fracValue > 0;
// On dartj2s the integer part may be large enough to be a floating
« no previous file with comments | « pkg/fixnum/test/int_64_vm_test.dart ('k') | pkg/intl/lib/src/date_format_field.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698