mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Fix BigFloat conversion issue
This commit is contained in:
parent
2ade6ebd8c
commit
c290eee90b
@ -56,9 +56,9 @@ struct Filter
|
|||||||
when FilterType::String
|
when FilterType::String
|
||||||
raw_value.as_s.downcase == value.to_s.downcase
|
raw_value.as_s.downcase == value.to_s.downcase
|
||||||
when FilterType::NumMin, FilterType::DateMin
|
when FilterType::NumMin, FilterType::DateMin
|
||||||
raw_value.as_bf >= BigFloat.new value.not_nil!.to_f32
|
BigFloat.new(raw_value.as_s) >= BigFloat.new value.not_nil!.to_f32
|
||||||
when FilterType::NumMax, FilterType::DateMax
|
when FilterType::NumMax, FilterType::DateMax
|
||||||
raw_value.as_bf <= BigFloat.new value.not_nil!.to_f32
|
BigFloat.new(raw_value.as_s) <= BigFloat.new value.not_nil!.to_f32
|
||||||
when FilterType::Array
|
when FilterType::Array
|
||||||
return true if value == "all"
|
return true if value == "all"
|
||||||
raw_value.as_s.downcase.split(",")
|
raw_value.as_s.downcase.split(",")
|
||||||
@ -113,14 +113,3 @@ struct SubscriptionList
|
|||||||
File.write @path, @ary.to_pretty_json
|
File.write @path, @ary.to_pretty_json
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
struct JSON::Any
|
|
||||||
def as_bf : BigFloat
|
|
||||||
i64_or_f32 = begin
|
|
||||||
as_i64
|
|
||||||
rescue
|
|
||||||
as_f32
|
|
||||||
end
|
|
||||||
BigFloat.new i64_or_f32
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user