diff --git a/app/models/advanced_searches/base.rb b/app/models/advanced_searches/base.rb index 288142d1..bc1c9904 100644 --- a/app/models/advanced_searches/base.rb +++ b/app/models/advanced_searches/base.rb @@ -104,7 +104,24 @@ def modified_param_for_operation_type(operation_type, param) else '%s' end - sprintf(fragment, param) + + if is_numeric_operation?(operation_type) + sprintf(fragment, param.to_f) + else + sprintf(fragment, param) + end + end + + def is_numeric_operation?(operation) + [ + 'is_above', + 'is_below', + 'is_less_than', + 'is_greater_than', + 'is_greater_than_or_equal_to', + 'is_less_than_or_equal_to', + 'is_in_the_range' + ].include?(operation) end end end