Merge pull request #1286 from nyuszika7h/fix-math-calc-round

Math: Fix round() in calc command
This commit is contained in:
Valentin Lorentz 2017-03-27 19:15:44 +02:00 committed by GitHub
commit 3ce6ea189d

View File

@ -120,7 +120,7 @@ class Math(callbacks.Plugin):
_mathEnv['abs'] = abs
_mathEnv['max'] = max
_mathEnv['min'] = min
_mathEnv['round'] = round
_mathEnv['round'] = lambda x, y: round(x, int(y))
_mathSafeEnv = dict([(x,y) for x,y in _mathEnv.items()])
_mathSafeEnv['factorial'] = _factorial
_mathRe = re.compile(r'((?:(?<![A-Fa-f\d)])-)?'