aspose file tools*
The moose likes Java in General and the fly likes HSSF and getNumericCellValue() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "HSSF and getNumericCellValue()" Watch "HSSF and getNumericCellValue()" New topic
Author

HSSF and getNumericCellValue()

Andrew Mcmurray
Ranch Hand

Joined: Sep 24, 2005
Posts: 188
Hi all,

I am using cell.getNumericCellValue() to get the value of a cell. I want have the value as a string so I toString the Double. The problem is the string then has the decimal and the E for values that are too big. Like 3.65871133792E13 where I want like 365871133792. Any thoughts?

Thanks,

AMD
Ajay Singh
Ranch Hand

Joined: Dec 13, 2006
Posts: 182
use NumberFormat to format it,

String text = new DecimalFormat("############").format(call.getNumericCallValue());
Andrew Mcmurray
Ranch Hand

Joined: Sep 24, 2005
Posts: 188
Thanks Ajay

It looks like I only needed on '#' on the Decimal format and it seemed to work.

AMD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HSSF and getNumericCellValue()
 
Similar Threads
replace value of string
How to read follwing String
String to int
Passing a String by reference
Get the characters from String.