[jboss-jira] [JBoss JIRA] (JBRULES-3294) ExcelParser does not read double < .0001 from Excel cell
J T (Created) (JIRA)
jira-events at lists.jboss.org
Sat Nov 19 23:16:40 EST 2011
ExcelParser does not read double < .0001 from Excel cell
--------------------------------------------------------
Key: JBRULES-3294
URL: https://issues.jboss.org/browse/JBRULES-3294
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-decisiontables
Affects Versions: 5.3.0.Final
Environment: Run on Vista Eclipse Helios
Reporter: J T
Assignee: Mark Proctor
Using a minimal Excel spreadsheet as a decision table, and a simple rule that always fires, and passing a small number into a method on the rhs, if the number is <.0001, the value will be rounded to 0 and switched to an int. It looks like when the jxl command "cell.getContents()" is fired in the processSheet method, the return value is rounded for very small numbers. I believe that if the type is numeric, you should be able to get the value from jxl like:
double num;
if (cell.getType() == CellType.NUMBER)
{
NumberCell nc = (NumberCell) cell;
num = nc.getValue();
}
Then the call could be:
newCell(listeners, i, cellNum, String.valueOf(num), DataListener.NON_MERGED );
This should keep the precision of the number.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list