FormulaEvaluator float presicion problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

FormulaEvaluator float presicion problem

hi yegor,
I'm using FormulaEvaluator from Apache POI to evaluate 2 cells sum :

10.00 (Cell 1) + 0.80 (Cell 2) = 10.80

This sum in Excel shows 10.80 wich is true, but with POI's FormulaEvaluator the result is 10.799999998!

CellValue cellValue = evaluator.evaluate(cell);

This is not working.

Why is this wrong with Apache POI and how can i get the formula well evaluated? I'm not looking to round the result because i'm trying to validate every cell on that excel's two decimals only. Any suggestions?


Reply | Threaded
Open this post in threaded view

Re: FormulaEvaluator float presicion problem

Could you try using DataFormatter after using the FormulaEvaluator?

Sent from:

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]