Pound sign from number format?
NumberFormat nf 开发者_Python百科= NumberFormat.getCurrencyInstance(Locale.UK);
BigDecimal b = new BigDecimal("10");
System.out.println (String.format("Data %s", nf.format(b.doubleValue())));
This outputs
Data ?10
How can I get the pound sign, for US if I change locale it outputs dollar sign.
The problem is with the encoding in which your response is rendered. Go through this great tutorial
Your sample-code prints a £ just fine in my test. But I use urxvt-unicode - a console able to print unicode-characters. I think your console isn't able to print the unicode-char. Try another console or another medium (for example web, with correct encoding set).
精彩评论