Sha256: cd8bec85b6f9f37b4d2e7eea52fde3f7e219f2d6d3c6b12c6f1534d620e3ac1d
Contents?: true
Size: 557 Bytes
Versions: 1
Compression:
Stored size: 557 Bytes
Contents
# Helper methods to # - convert empty or integer values into BigDecimals module SK::Calc::Helper private # Init price single with 0 if nil and cast to BigDecimal # == Return # <BigDecimal> def conv_price_single to_bd(price_single || 0) end # Init tax with 0 if nil and cast to BigDecimal # == Return # <BigDecimal> def conv_tax to_bd( (self.respond_to?(:tax) && tax) || 0) end # Cast a val to BigDecimal # == Return # <BigDecimal> def to_bd(val) val.is_a?(BigDecimal) ? val : BigDecimal.new("#{val}") end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sk_calc-0.0.6 | lib/sk_calc/helper.rb |