• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HSSF and getNumericCellValue()

 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use NumberFormat to format it,

String text = new DecimalFormat("############").format(call.getNumericCallValue());
 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ajay

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

AMD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic