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.
How to output special characters in Prawn?
-
28-06-2022 - |
質問
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?
解決 2
他のヒント
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.
所属していません StackOverflow