avoid word-wrap when showing currency

This commit is contained in:
wvengen 2014-03-15 15:09:16 +01:00
parent 8853b3efdb
commit bb9269f755
2 changed files with 10 additions and 4 deletions

View file

@ -6,12 +6,12 @@ en:
number:
currency:
format:
unit: ! '€ '
unit: ! "€\u202f"
nl:
number:
currency:
format:
delimiter: ! ' '
unit: ! '€ '
delimiter: ! "\u202f"
unit: ! "€\u202f"
format:
delimiter: ! ' '
delimiter: ! "\u202f"

View file

@ -11,6 +11,7 @@ class OrderPdf < Prawn::Document
#options[:bottom_margin] ||= 40
super(options)
@order = order
@options = options
end
def to_pdf
@ -29,4 +30,9 @@ class OrderPdf < Prawn::Document
def save_tmp
File.open("#{Rails.root}/tmp/#{self.class.to_s.underscore}.pdf", 'w') {|f| f.write(to_pdf.force_encoding("UTF-8")) }
end
# XXX avoid underscore instead of unicode whitespace in pdf :/
def number_to_currency(number, options={})
super(number, options).gsub("\u202f", ' ')
end
end