Have just had a look at your workbook and I think I understand the root of
the problem.

If you use Excel to open your workbook, click on one of the cells that holds
a numeric value and then try to format it, Excel will report that the cell
is not a numeric cell but is a General one. General cells can hold any value
but they cannot have a formatting string applied to their contents. To my
mind, you have two options and both are very quick to test out.

Option 1 is to recover the contents of the cell, round that value using the
Math.round() function that is built into the core Java api and then write
the result back into the cell. Option two is to explicitly set the type of
the cell to numeric using POI. This could be done at the same time as
applying the format. If I have the time, I will try both and let you know
the outcome.

Yours

Mark B

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Round-to-one-Decimal-place-not-happenning-using-style-setDataFormat-format-getFormat-0-0-tp3404980p3406444.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org

Reply via email to