Displaying currency symbols in select

Discussion in 'Ruby' started by James Sturrock, Aug 17, 2007.

  1. 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?
    --
    Posted via http://www.ruby-forum.com/.
    James Sturrock, Aug 17, 2007
    #1
    1. Advertising

  2. James Sturrock

    Eric Guest

    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)
    --
    Groeten,
    Eric
    Eric, Aug 18, 2007
    #2
    1. Advertising

  3. James Sturrock wrote:
    > 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
    --
    Posted via http://www.ruby-forum.com/.
    Stefan Rusterholz, Aug 19, 2007
    #3
  4. Stefan Rusterholz wrote:
    >
    > 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?
    --
    Posted via http://www.ruby-forum.com/.
    James Sturrock, Aug 19, 2007
    #4
  5. James Sturrock wrote:
    > Stefan Rusterholz wrote:
    >>
    >> 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?


    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
    --
    Posted via http://www.ruby-forum.com/.
    Stefan Rusterholz, Aug 19, 2007
    #5
  6. Stefan Rusterholz wrote:
    > 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.
    --
    Posted via http://www.ruby-forum.com/.
    James Sturrock, Aug 20, 2007
    #6
  7. James Sturrock, Aug 20, 2007
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Blum

    Re: allow all currency symbols

    Peter Blum, Oct 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    470
    magister
    Nov 3, 2004
  2. Adam Monsen
    Replies:
    0
    Views:
    370
    Adam Monsen
    Dec 19, 2007
  3. David C

    Currency Symbols

    David C, Oct 9, 2009, in forum: ASP .Net
    Replies:
    8
    Views:
    501
    Gregory A. Beamer
    Oct 12, 2009
  4. JPike

    Currency Symbols in tooltip

    JPike, Nov 11, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    124
    JPike
    Nov 15, 2004
  5. J P Singh

    Storing Currency Symbols in Database

    J P Singh, Jan 27, 2004, in forum: ASP General
    Replies:
    4
    Views:
    265
    Aaron Bertrand - MVP
    Jan 27, 2004
Loading...

Share This Page