You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Natalie Horsch <nh...@digimax.com> on 2003/02/18 00:25:04 UTC

How to read numeric formatting?

Hello,

I was wondering if someone could help me.

I have cells displaying formula results with restricted decimal places
due to formatting on the cell, but actually containing numbers with more
decimal places.  When I read this value using HSSFCell.getNumericValue,
it is returning the whole number, but I only want the rounded one.  

Is there a way to get just what is displayed?  

Alternatively, can I check what the cell format is set to so I can round
to the correct decimal places in the same way as in the worksheet?  I
got the DataFormat from CellStyle, but don't know how to interpret it.

Thanks,

Natalie