lib/rents/currency.rb in rents-1.0.7 vs lib/rents/currency.rb in rents-1.0.8
- old
+ new
@@ -4,11 +4,11 @@
# Receive it amount in Decimal and convert to operator str, like 10,00 or 10.00 to 1000
def self.to_operator_str(amount)
# Check invalid entry
return nil if amount.nil?
return amount.to_s if amount.is_a?Integer
- return amount if amount.is_a?(String) && amount.index('.').nil? && amount.index(',').nil?
amount = format('%.2f', amount) if amount.to_s.float?
+ return amount if amount.is_a?(String) && amount.index('.').nil? && amount.index(',').nil?
if amount.is_a?String
return amount if amount.index('.').nil? && amount.index(',').nil?
amount = amount.remove('.')
\ No newline at end of file