You should use the number format "#.0"
. A "#" character indicates that a digit should be there only if necessary to represent the number, and a "0" character indicates that a digit must be there, even if it's unnecessary to represent the number. For further reference, please see the Excel format symbols.
The "#.0"
format will work whether you are using NumberFormat
in JXL or you are creating a data format string with DataFormat
in Apache POI.