No console output of comma [message #1722328] |
Thu, 04 February 2016 07:53 |
Black Smith Messages: 1 Registered: February 2016 |
Junior Member |
|
|
Hi,
I use eclipse ide for java for java programming. I want to format 10999.9999 to 11,000.00. Here is the code I wrote:
String x = "10999.9999";
double y = Double.parseDouble(x);
DecimalFormat formatter = new DecimalFormat("#,###.00");
System.out.println(formatter.format(y));
Then it gives output 11000.00 , no comma. I compiled the code with CMD with same jjdk1.8.0_05 and it works perfectly. I tried almost every other way to compile the code but it hasn't worked yet.
In my eclipse, I can never print comma and few other characters like # ; in console. I tried just to print comma as char value and it shows console blank. Please help me........
-
Attachment: Capture1.PNG
(Size: 8.46KB, Downloaded 456 times) -
Attachment: Capture2.PNG
(Size: 4.05KB, Downloaded 338 times) -
Attachment: Capture3.PNG
(Size: 4.23KB, Downloaded 495 times) -
Attachment: Capture4.PNG
(Size: 5.17KB, Downloaded 336 times)
|
|
|
Powered by
FUDForum. Page generated in 0.02528 seconds