|
From: <rob...@us...> - 2009-08-21 20:08:35
|
Revision: 22577
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=22577&view=rev
Author: rob_wheeler
Date: 2009-08-21 20:08:23 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
round percentage to nearest integer
Modified Paths:
--------------
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/pr2_widgets.js
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/pr2_widgets.js
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/pr2_widgets.js 2009-08-21 20:03:36 UTC (rev 22576)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/pr2_widgets.js 2009-08-21 20:08:23 UTC (rev 22577)
@@ -48,7 +48,7 @@
receive: function(msg) {
if(msg[this.key] != null) {
- this.percent = 100. * parseFloat(msg[this.key]) / parseFloat(msg[this.key2]);
+ this.percent = Math.round(100. * parseFloat(msg[this.key]) / parseFloat(msg[this.key2]));
if (this.percent > 100) this.percent = 100;
else if (this.percent < 0) this.percent = 0;
this.draw();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|