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

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: Some fixes from CL 11748016. Created 7 years, 10 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
Index: pkg/intl/lib/number_format.dart
diff --git a/pkg/intl/lib/number_format.dart b/pkg/intl/lib/number_format.dart
index 8a8a09554ee1dad4b820aa99e26a41ff91fcab52..aa79ad47df0e30a7152319c16c250d9f801495c4 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

Powered by Google App Engine
This is Rietveld 408576698