Module: check_mk
Branch: master
Commit: c2c2d4df95e2fd271992c3a645f3a978cd776e4d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c2c2d4df95e2fd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 26 11:57:14 2016 +0200
Fixed exception in recent implemented scientific graph value rendering
---
web/htdocs/lib.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 79c77f4..29b9062 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -485,6 +485,11 @@ def frexp10(x):
def render_scientific(v, precision=3):
+ if v == 0:
+ return "0"
+ elif v < 0:
+ return "-" + render_scientific(v, precision)
+
mantissa, exponent = frexp10(float(v))
# Render small numbers without exponent
if exponent >= -3 and exponent <= 4: