0

I have a parser class which uses Apache POI to parse Excel files.

When a cell contains 1.0, I would like to convert it to String "1". And when I get 1.1I would like to parse it to "1.1"

How to do that ?

I have try some experiments without success like that:

try
  doubleValue.toInt
catch
{
  case _ => doubleValue.toString
}

Or by using the Integer.parseInt()method.

4

1 に答える 1