Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with currency symbol

 
Sam England
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
TIA
------------------
Sam.
Coffee time now...
 
Martin Rennix
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sam,
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?
Martin
 
shilpa kulkarni
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MMmmmm

I also tried:



and still got the output:

currency = �23.12
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wanna join this discussion?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic