aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-04-21 10:45:57 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-04-21 10:45:57 -0700
commit3d4cc9e9312a954a79ee7df7ffe0fc0495c37b24 (patch)
tree0c5dfc3ea461183bc5abe4a5a649240b6c3bc328 /src
parent5128461279805416694953c78bfbc7ad4bcde7be (diff)
fix for printing very small floats
Diffstat (limited to 'src')
-rw-r--r--src/library.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 54834d17..7653d446 100644
--- a/src/library.js
+++ b/src/library.js
@@ -134,6 +134,7 @@ var Library = {
}
if (precision >= 0) {
if (isFloatArg(next)) {
+ argText = (Math.round(currArg*Math.pow(10,precision))/Math.pow(10,precision)).toString();
var dotIndex = argText.indexOf('.');
if (dotIndex == -1 && next == 'f'.charCodeAt(0)) {
dotIndex = argText.length;