http://www.roseindia.net
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Please visit our lastest forum and start dicussing the topics
why Java will round the value???

 
Post new topic   Reply to topic    http://www.roseindia.net Forum Index -> Core Java Interview Questions
View previous topic :: View next topic  
Author Message
kalyani
Guest





PostPosted: Thu May 03, 2007 2:48 am    Post subject: why Java will round the value??? Reply with quote

Hi,

I have a problem in Java...Problem was...

We have created one website called "STATS" in that website the user need to enter the Qty,Price,Date to confirm their Purchase Orders.After confirming their orders the price gets round up automatically...

For Ex :Price: 4.10 for 1 Item Qty : 40
3.06 for 2nd item Qty : 30
14.82 for 3rd Item Qty : 20
2.67 for 4th Item Qty : 20
383.44 for 5th Item Qty : 1
When the user enters the above information and select "Confirm" button ,,,then Subtotal, GST, TotalAmount will be calculated automatically.
All the details will store in 2 SQL Tables...,,,All the price information will store in Details table..

But now the prob was: if i give the above price and qty Subtotal will be 988.89,,GST will be 49.44,,Total Price will be 1038.33..

But when i calculate with calculator the exact price must be as : Sub total : 989.04,,GST : 49.45,,,TotalPrice : 1038.49...

Why the Java compiler is rounding the value..can we solve this problem.???

We are using Java Platform/2003 Os/JDK 1.3 version and the Database SQL 2000 Developer Edition,,and also JRUN 3.0..


please help on this>..

Kalyani
Back to top
Display posts from previous:   
Post new topic   Reply to topic    http://www.roseindia.net Forum Index -> Core Java Interview Questions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group