aspose file tools*
The moose likes Beginning Java and the fly likes having problem with storing a double value... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "having problem with storing a double value..." Watch "having problem with storing a double value..." New topic
Author

having problem with storing a double value...

raghu tammina
Ranch Hand

Joined: Jul 11, 2012
Posts: 60
Hi,

I am storing a double value 9999 to database.when i am retrieving the value i'm getting is '9999' but i want 9999.0.

help me how to get it.

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14350
    
  22

A number is just a number. It doesn't have a format by itself. There's no difference between a double that holds the value '9999' and one thatholds the value '9999.0'. When you convert the number to a string, in order to display it, then you specify how it should be formatted, for example with a certain number of decimal digits.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: having problem with storing a double value...