Find more posts tagged with
Sort by:
1 - 3 of
31
Ok, now that I know that I'm picky 
Let's get started. Now as I know where to search for the formating function (com.rapidminer.Tools.TimeFormat#format(long) I've looked it up myself. Your solution is right but there is a bug. ;D
Formatting 60000 would result in "60s". In line 108 your checking if your ms-value is bigger than the desired "unit multiplicator", but 60s is exactly one minute even if it's not bitter than one minute. You should check for bigger or equal.
By the way: You are using Time Format only with the default constructor. This way you have secondsFormat = new DecimalFormat("0"). This uses half_even rounding as default (http://java.sun.com/javase/6/docs/api/java/text/DecimalFormat.html). So even 59500 ms would be rendered as "60s".
*pickymodeoff*
Best regards,
Michael

Let's get started. Now as I know where to search for the formating function (com.rapidminer.Tools.TimeFormat#format(long) I've looked it up myself. Your solution is right but there is a bug. ;D
Formatting 60000 would result in "60s". In line 108 your checking if your ms-value is bigger than the desired "unit multiplicator", but 60s is exactly one minute even if it's not bitter than one minute. You should check for bigger or equal.
By the way: You are using Time Format only with the default constructor. This way you have secondsFormat = new DecimalFormat("0"). This uses half_even rounding as default (http://java.sun.com/javase/6/docs/api/java/text/DecimalFormat.html). So even 59500 ms would be rendered as "60s".
*pickymodeoff*
Best regards,
Michael
... and I thought I was picky ;D ...
After a short laugh I gave myself 5 minutes to check where this error comes from. The function doing the formatting com.rapidminer.Tools#format(long) seems to be okay, so I guess you have found on the rare occasions where the storage of numbers with a limited number of bits shows its ugly face. I wouldnt wonder if the milliseconds have represented a value 59,9999999999999999999999999999999.... (sorry, no bits left) seconds.
kind regards,
Steffen