Merge pull request #7634 from mvdbeek/fix_float_to_inst_casting

[19.01] Fix float to int casting
This commit is contained in:
Dannon
2019-04-01 09:26:33 -04:00
committed by GitHub
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ class InputValueWrapper(ToolParameterValueWrapper):
return getattr(self.value, key)
def __int__(self):
return int(str(self))
return int(float(self))
def __float__(self):
return float(str(self))
+5 -2
View File
@@ -1,9 +1,11 @@
<tool id="cheetah_casting" name="cheetah_casting" version="1.0.0">
<command>
#set $int_val_inc = int($inttest) + 1
#set $int_flot_val_inc = int($floattest) + 1
#set $float_val_inc = float($floattest) + 1
echo $int_val_inc >> $out_file1;
echo $float_val_inc >> $out_file1;
echo $int_val_inc >> '$out_file1';
echo $int_flot_val_inc >> '$out_file1';
echo $float_val_inc >> '$out_file1';
</command>
<inputs>
<param name="inttest" value="1" type="integer" />
@@ -19,6 +21,7 @@
<output name="out_file1">
<assert_contents>
<has_line line="2" />
<has_line line="3" />
<has_line line="3.5" />
</assert_contents>
</output>