mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Adapt preferable to work with new BigDecimal version
BigDecimal raises exception if called with nil or empty values
This commit is contained in:
@@ -115,6 +115,7 @@ module Spree
|
||||
when :password
|
||||
value.to_s
|
||||
when :decimal
|
||||
value = 0 if value.blank?
|
||||
BigDecimal(value.to_s).round(2, BigDecimal::ROUND_HALF_UP)
|
||||
when :integer
|
||||
value.to_i
|
||||
|
||||
Reference in New Issue
Block a user