FileDocCategorySizeDatePackage
TestPercentPtg.javaAPI DocApache Poi 3.0.11962Mon Jan 01 12:39:46 GMT 2007org.apache.poi.hssf.record.formula

TestPercentPtg

public class TestPercentPtg extends AbstractPtgTestCase
Tests for {@link PercentPtg}.
author
Daniel Noll (daniel at nuix dot com dot au)

Fields Summary
Constructors Summary
Methods Summary
public voidtestReading()
Tests reading a file containing this ptg.

        HSSFWorkbook workbook = loadWorkbook("PercentPtg.xls");
        HSSFSheet sheet = workbook.getSheetAt(0);

        assertEquals("Wrong numeric value for original number", 53000.0,
                     sheet.getRow(0).getCell((short) 0).getNumericCellValue(), 0.0);
        assertEquals("Wrong numeric value for percent formula result", 5300.0,
                     sheet.getRow(1).getCell((short) 0).getNumericCellValue(), 0.0);
        assertEquals("Wrong formula string for percent formula", "A1*10%",
                     sheet.getRow(1).getCell((short) 0).getCellFormula());