projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97f1f38
)
Roo/util/Math.js
author
Alan Knowles
<alan@akbkhome.com>
Wed, 12 Jan 2011 05:26:44 +0000
(13:26 +0800)
committer
Alan Knowles
<alan@akbkhome.com>
Wed, 12 Jan 2011 05:26:44 +0000
(13:26 +0800)
Roo/util/Math.js
patch
|
blob
|
history
diff --git
a/Roo/util/Math.js
b/Roo/util/Math.js
index
96c154e
..
1b10ad7
100644
(file)
--- a/
Roo/util/Math.js
+++ b/
Roo/util/Math.js
@@
-201,7
+201,18
@@
Roo.util.Math.prototype = {
toFixed : function(x) {
var n = new Roo.util.Math(this);
n.precision = x;
- return n.round().toString();
+ var ret= n.round().toString();
+ var lr =ret.split('.');
+ var l = lr.shift();
+ if (!x) {
+ return l;
+ }
+ var r = lr.length ? lr[0] : '';
+ for (var i = r.length; i < x; i++) {
+ r+= '0';
+ }
+ return l+'.'+r;
+
},
_zeroes : function(n, l, t){
var s = ["push", "unshift"][t || 0];