Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Compiled Languages > Java   »   formatting error

 
Question Tools Search this Question Display Modes
Question
 
 
#1  
Old Jun 30, 2008, 03:39 AM
javeriaz
New Member
javeriaz is offline
 
Join Date: Jun 2008
Posts: 1
javeriaz See this member's comment history on his/her Profile page.
formatting error

i'm new with java.. following the book "teach yourself java in 21 days"

i tried to print
System.out.format("%,d%n", total[0]);
and it printed 5a000a000 instead of 5,000,000

why???

Reply With Quote
 
     

Answers
 
 
Old Jul 7, 2008, 05:55 PM   #2  
jstrike
Full Member
jstrike is offline
 
Join Date: May 2007
Location: Wisconsin - Go Packers!
Posts: 389
jstrike See this member's comment history on his/her Profile page.
Quote:
Originally Posted by javeriaz
i'm new with java.. following the book "teach yourself java in 21 days"

i tried to print
System.out.format("%,d%n", total[0]);
and it printed 5a000a000 instead of 5,000,000

why???
The statement is correct and when I ran it on my machine I got the correct result.
What OS are you running this on?
What are you using to compile?
I would recommend you place: System.out.println(total[0]); on the line right before the format just to make sure the value in total[0] is what you expect.
  Reply With Quote
 
     


Question Tools Search this Question
Search this Question:

Advanced Search
Display Modes

 
Similar Sponsors

Similar Questions
Question Asker Topic Answers Last Post
Low level formatting error in FORUS audio recorder naila99 Computers for Beginners 1 Apr 5, 2008 01:16 AM
mp4 player formatting error michaelon2002 MP3 0 Jan 5, 2008 09:12 PM
my mp3 player giving write protect error while formatting itguy_ajit MP3 2 Jan 3, 2008 08:31 AM
Formatting HD poseidon Desktops 7 Mar 12, 2006 12:20 PM
Formatting Xp Pro Help keiththebeast Windows 3 Feb 19, 2006 08:10 AM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 02:15 PM.

Content Relevant URLs by vBSEO 3.0.0 RC6 © 2006, Crawlability, Inc.