Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed formatDecimal so that it won't display, for example, 1.100 inst…

…ead of 2.00; thanks to Aaron Bessey for the patch.

git-svn-id: http://ringdroid.googlecode.com/svn/trunk@32 35bc551c-9c80-11dd-979b-47109e308e52
  • Loading branch information...
commit 18cda458b06ab64bdf880460faf828c27066bbae 1 parent 7c08bd4
authored
9  src/com/ringdroid/RingdroidEditActivity.java
@@ -798,6 +798,15 @@ private String formatTime(int pixels) {
798 798
     private String formatDecimal(double x) {
799 799
         int xWhole = (int)x;
800 800
         int xFrac = (int)(100 * (x - xWhole) + 0.5);
  801
+
  802
+        if (xFrac >= 100) {
  803
+            xWhole++; //Round up
  804
+            xFrac -= 100; //Now we need the remainder after the round up
  805
+            if (xFrac < 10) {
  806
+                xFrac *= 10; //we need a fraction that is 2 digits long
  807
+            }
  808
+        }
  809
+
801 810
         if (xFrac < 10)
802 811
             return xWhole + ".0" + xFrac;
803 812
         else

0 notes on commit 18cda45

Please sign in to comment.
Something went wrong with that request. Please try again.