1

I am unable to properly read numeric cells which has ROUNDUP in the formula, for example

Cell C25 is =ROUNDUP(5296.43899096,2)

it shows 5296.44 in Excel but the below code

    Cell cell = worksheet.getCell("C25");
    System.out.println( cell.getNumber() );

gives output as 5296.4400000000005, please help

Konstantin V. Salikhov
  • 4,554
  • 2
  • 35
  • 48
zambezi
  • 21
  • 2

1 Answers1

0

You are probably reading the xml information. And the issue has to do, in part, with the impossibility of representing certain decimal values in binary format, as well as with how MS stores the data. See this Critique of Excel XML format

The XML shows how information is stored. It does not directly show how information is displayed. But it is interesting that 5296.44, as a direct entry, will be stored as 5296.44, but the result of the ROUND formula will be stored as 5296.4400000000005

Ron Rosenfeld
  • 53,870
  • 7
  • 28
  • 60