projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f58154
)
Roo/util/Format.js
author
Alan Knowles
<alan@akbkhome.com>
Mon, 25 Oct 2010 06:54:39 +0000
(14:54 +0800)
committer
Alan Knowles
<alan@akbkhome.com>
Mon, 25 Oct 2010 06:54:39 +0000
(14:54 +0800)
Roo/util/Format.js
patch
|
blob
|
history
diff --git
a/Roo/util/Format.js
b/Roo/util/Format.js
index
a0d8d55
..
5e515b9
100644
(file)
--- a/
Roo/util/Format.js
+++ b/
Roo/util/Format.js
@@
-127,12
+127,16
@@
Roo.util.Format = function(){
toFixed : function(v, n)
{
// why not use to fixed - precision is buggered???
+ if (!n) {
+ return Math.round((v-0);
+ }
var fact = Math.pow(10,n);
v = (Math.round((v-0)*fact))/fact;
var z = (''+fact).substring(1);
if (v == Math.floor(v)) {
return Math.floor(v) + '.' + z;
}
+
// now just padd decimals..
var ps = String(v).split('.');
var r = (ps[1] + z).substring(0,z.length);