Skip to content

Commit

Permalink
Merge pull request #21 from dornhege/groovy-devel
Browse files Browse the repository at this point in the history
I confirmed that the proposed part (to avoid float value rounded) works, by unit test file I'll upload later.

I haven't been able to test With real robots -- I only have an access to `PR2`, of which dashboard overrides `BatteryDashWidget`.`update_time` method.
  • Loading branch information
Isaac Saito committed Apr 25, 2013
2 parents 73ad287 + d069b40 commit dac975e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,8 @@ def _update_state(self, state):
self.setIcon(self._icons[state])

def update_time(self, value):
self.setToolTip("%s%% remaining" % value)
try:
fval = float(value)
self.setToolTip("%s: %.2f%% remaining" % (self.name, fval))
except ValueError:
self.setToolTip("%s: %s%% remaining" % (self.name, value))

0 comments on commit dac975e

Please sign in to comment.