How can I set the formula with the calculation of percentage value in Apache POI?
And how can it be a full value?
For example, if it is By the form, you have 2 cells with try this is output A1 Change negative, and it will still work. -4.00% , then it should be
4.00
A1 and
B1 numbers (in my example, these numbers are 2411 and 1333), and the formula in the cell is called
C = A1 / B1
System.out.println ("formula" + cell 1 .getCellFormula ()); If (cell 1.getCellType () == cell.cell_TYPE_FORMULA) {cellvalue CV = evaluator. Evaluation (cell 1); System.out.println ("cv" + cv.formatAsString ()); Decimalable df = new passphrase ("###. ##%"); System.out.println ("formatted as percent" + df.format (Math.base (Cell 1.getNumericCellValue ())); }
formula A1 / B1 cv 1.808702175543886% formatted as 180.87%
Comments
Post a Comment