More work from avik

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352561 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew C. Oliver 2002-04-30 00:18:47 +00:00
parent e01cb449a6
commit d83491053b

View File

@ -75,6 +75,7 @@ import java.util.GregorianCalendar;
/**
* @author Andrew C. Oliver (acoliver at apache dot org)
* @author Avik Sengupta
*/
public class TestFormulas
@ -476,6 +477,44 @@ extends TestCase {
assertTrue("file exists",file.exists());
}
/**
* Tests creating a file with floating point in a formula.
*
*/
public void testFloat()
throws Exception {
String operator = "+";
short rownum = 0;
File file = File.createTempFile("testFormulaFloat",".xls");
FileOutputStream out = new FileOutputStream(file);
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet s = wb.createSheet();
HSSFRow r = null;
HSSFCell c = null;
for (short x = 1; x < Short.MAX_VALUE && x > 0; x=(short)(x*2)) {
r = s.createRow((short) x);
for (short y = 1; y < 256 && y > 0; y++) {
c = r.createCell((short) y);
c.setCellFormula("" + (100*x)+"."+y + operator + (10000*y) +
"."+x);
}
}
wb.write(out);
out.close();
assertTrue("file exists",file.exists());
}
public static void main(String [] args) {