lib/br_danfe/helper.rb in br_danfe-0.17.0 vs lib/br_danfe/helper.rb in br_danfe-0.17.1
- old
+ new
@@ -18,10 +18,10 @@
separated_number = number.to_s.split('.')
integer_part = separated_number[0].reverse.gsub(/\d{3}(?=\d)/, '\&.').reverse
decimal_part = separated_number[1] || '00'
decimal_part += '0' if decimal_part.size < 2
- integer_part + ',' + decimal_part
+ "#{integer_part},#{decimal_part}"
end
def self.format_datetime(xml_datetime, with_time_zone: false)
formated = with_time_zone ? '%d/%m/%Y %H:%M:%S%:z' : '%d/%m/%Y %H:%M:%S'
xml_datetime.present? ? Time.parse(xml_datetime).strftime(formated) : ''