Question

I am trying to output currency symbols in Prawn with a helper method like this:

def price(number)
  @view.number_to_currency(number, :unit => "€")
end

I then use it like this:

price(@invoice.total)

Unfortunately it's not working and instead of I get € in my PDF documents.

(The same number_to_currency function works great outside of Prawn by the way.)

Can anybody help?

Was it helpful?

Solution 2

OK, I solved it by just using special characters like instead of HTML-entities like €. I had to tweak my app a bit to achieve that, though.

OTHER TIPS

Have a look at this railscast under the heading "Formatting The Currency Fields". Looks like you don't have to escape the the currency symbols.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top