File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
python/plugins/processing/core Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 30
30
31
31
import sys
32
32
import os
33
+ import math
33
34
from inspect import isclass
34
35
from copy import deepcopy
35
36
import numbers
@@ -834,6 +835,8 @@ def setValue(self, n):
834
835
try :
835
836
v = self ._evaluate (n )
836
837
self .value = float (v )
838
+ if self .isInteger :
839
+ self .value = int (math .floor (self .value ))
837
840
return True
838
841
except :
839
842
return False
@@ -877,7 +880,10 @@ def _evaluate(self, value):
877
880
result = exp .evaluate (_expressionContext ())
878
881
if exp .hasEvalError ():
879
882
raise ValueError ("Error evaluating parameter expression: " + exp .evalErrorString ())
880
- return result
883
+ if self .isInteger :
884
+ return math .floor (result )
885
+ else :
886
+ return result
881
887
882
888
def evaluate (self , alg ):
883
889
if isinstance (self .value , str ) and bool (self .value ):
You can’t perform that action at this time.
0 commit comments