jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes Help with currency symbol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with currency symbol" Watch "Help with currency symbol" New topic

Help with currency symbol

Sam England

Joined: Oct 01, 2001
Posts: 2
Can someone tell me how to print a '�' from a java prog, currently it is replaced (in the output) with another symbol. This (�) is the symbol for GPB like $ is for USD.
Coffee time now...

Sam.<BR>Coffee time now...
Martin Rennix
Ranch Hand

Joined: Sep 30, 2001
Posts: 34
Are you writing a console or GUI app? I had the same problem runnning a console app. It's to do with the code page of your platform I think. Saying that, I tried changing the code page with the mode command (Win2000) but I still can't display a � sign.
Can anyone else help?
shilpa kulkarni
Ranch Hand

Joined: Jun 07, 2000
Posts: 87
i tried this code, it displays some funky symbol, i wonder why....
import java.text.NumberFormat;
import java.util.Locale;
NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.UK);
System.out.println("currency = "+nf.format(23.12));
Maureen Charlton
Ranch Hand

Joined: Oct 04, 2004
Posts: 218

I also tried:

and still got the output:

currency = �23.12
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
Wanna join this discussion?

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link: http://aspose.com/file-tools
subject: Help with currency symbol
It's not a secret anymore!