Displaying currency symbols in select

J

James Sturrock

I can't seem to get a £ symbol to display correctly in a form select
element.

I have tried:
number_to_currency(u.price, :unit => "&pound")
number_to_currency(u.price, :unit => "£")
h ( number_to_currency(u.price, :unit => "&pound") )
h ( number_to_currency(u.price, :unit => "£") )

They all display a ? or "£"

Is there a way around this?
 
E

Eric

Op vr 17 aug 10:10:04 2007 CEST schreef James Sturrock in
de nieuwsgroep 'comp.lang.ruby':
I can't seem to get a £ symbol to display correctly in a form select
element.

I have tried:
number_to_currency(u.price, :unit => "&pound")
number_to_currency(u.price, :unit => "£")
h ( number_to_currency(u.price, :unit => "&pound") )
h ( number_to_currency(u.price, :unit => "£") )

They all display a ? or "£"

Is there a way around this?

Are u using a character set that contains the pound sign? (Like UTF-8)
 
S

Stefan Rusterholz

James said:
I can't seem to get a £ symbol to display correctly in a form select
element.

I have tried:
number_to_currency(u.price, :unit => "&pound")
number_to_currency(u.price, :unit => "£")
h ( number_to_currency(u.price, :unit => "&pound") )
h ( number_to_currency(u.price, :unit => "£") )

They all display a ? or "£"

Is there a way around this?

Well, you should close it with a ;, "£", not "&pound".

Regards
Stefan
 
J

James Sturrock

Stefan said:
Well, you should close it with a ;, "£", not "&pound".

Regards
Stefan

I have tried it with the ';' and its still doesn't work. Has anybody
else managed to display a £ sign in a form select?
 
S

Stefan Rusterholz

James said:
I have tried it with the ';' and its still doesn't work. Has anybody
else managed to display a £ sign in a form select?

I don't have any problem with neither £ nor with charset set to
utf-8 and a literal £ in utf-8.
Maybe you should take a look at what rails emits? (I don't use rails, so
forgive my ignorance, but maybe rails escapes the £ to
&ound;?)

Regards
Stefan
 
J

James Sturrock

Stefan said:
I don't have any problem with neither £ nor with charset set to
utf-8 and a literal £ in utf-8.
Maybe you should take a look at what rails emits? (I don't use rails, so
forgive my ignorance, but maybe rails escapes the £ to
&ound;?)

Regards
Stefan

Rails is outputting £

I don't think this is a character set issue as I am displaying the £
sign elsewhere on the page (just as text not in a form element) and it
displays correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top