DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8624>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8624

[PATCH] formulas:- handle floats and misc cleanup





------- Additional Comments From [EMAIL PROTECTED]  2002-04-29 17:46 -------
Add the following to createPtg(byte [] data, int offset) in Ptg.java . Sorry, 
couldnt figure how to create an incremental patch, full patch takes too much 
time. 
------------------------------------------------------------------------------
 case NumberPtg.sid :
                retval = new NumberPtg(data, offset);
                break;

------------------------------------------------------------------------------
Also, add the following to testcases/../../usermodel/TestFormulas.java .. the 
test writes correctly, still working on the read, which works, except for the 
fact that one needs to take care of the fact that anything written as 1.10 will 
come back as 1.1
-------------------------------------------------------------------------------
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());
              
        
    }

-------------------------------------------------------------------------------

Reply via email to