mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Code beautifier
- standardfilters.rb - standard_filter_test.rb
This commit is contained in:
@@ -209,16 +209,16 @@ module Liquid
|
||||
|
||||
private
|
||||
|
||||
def to_number(obj)
|
||||
case obj
|
||||
when Numeric
|
||||
obj
|
||||
when String
|
||||
(obj.strip =~ /^\d+\.\d+$/) ? obj.to_f : obj.to_i
|
||||
else
|
||||
0
|
||||
def to_number(obj)
|
||||
case obj
|
||||
when Numeric
|
||||
obj
|
||||
when String
|
||||
(obj.strip =~ /^\d+\.\d+$/) ? obj.to_f : obj.to_i
|
||||
else
|
||||
0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -176,4 +176,3 @@ class StandardFiltersTest < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user