Module: check_mk
Branch: master
Commit: 5f51d67e52bd6bf948f571bd8d39e53460cf3303
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5f51d67e52bd6b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 20 09:54:29 2013 +0100
Fixed input rendering of float valuespec
---
web/htdocs/valuespec.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index a5015a4..5435948 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -231,7 +231,7 @@ class Integer(ValueSpec):
else:
return 0
- def render_input(self, varprefix, value):
+ def render_input(self, varprefix, value, convfunc = saveint):
if self._label:
html.write(self._label)
html.write(" ")
@@ -239,7 +239,7 @@ class Integer(ValueSpec):
style = "text-align: right;"
else:
style = ""
- html.number_input(varprefix, self._display_format % saveint(value), size =
self._size, style = style)
+ html.number_input(varprefix, self._display_format % convfunc(value), size =
self._size, style = style)
if self._unit:
html.write(" ")
html.write(self._unit)
@@ -840,6 +840,9 @@ class Float(Integer):
self._display_format = kwargs.get("display_format", "%.2f")
self._allow_int = kwargs.get("allow_int", False)
+ def render_input(self, varprefix, value):
+ Integer.render_input(self, varprefix, value, convfunc = savefloat)
+
def canonical_value(self):
return float(Integer.canonical_value(self))