Retain formatting of a Double value - Java

前端 未结 3 1987
执念已碎
执念已碎 2021-01-23 04:37

I am using Poi to create Excel workbooks in Java. My raw data comes in as a string. I need to format the data to enter two decimal places into the cell where the number is bei

3条回答
  •  半阙折子戏
    2021-01-23 04:53

    You are actually doing nothing in most part of the code you described. You might as well just return Double.parseDouble(inputString). Doubles are stored in binary format and the leadin/trailing zeros make no sense. Perhaps the BigDecimal class is something for you.

提交回复
热议问题