class Money

Public Instance Methods

to_euro() click to toggle source
# File lib/ascii_invoicer/mixins.rb, line 29
def to_euro
  self
end
to_s() click to toggle source
# File lib/ascii_invoicer/mixins.rb, line 22
def to_s
  value = self.amount
  a,b = sprintf("%0.2f", value.to_s).split('.')
  a.gsub!(/(\d)(?=(\d{3})+(?!\d))/, '\\1.')
  "#{a}#{self.currency.separator}#{b}#{self.currency.symbol}"
end