[jboss-jira] [JBoss JIRA] (JBRULES-3294) ExcelParser does not read double < .0001 from Excel cell
Fernando Meyer (Commented) (JIRA)
jira-events at lists.jboss.org
Sat Dec 10 04:39:40 EST 2011
[ https://issues.jboss.org/browse/JBRULES-3294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12649726#comment-12649726 ]
Fernando Meyer commented on JBRULES-3294:
-----------------------------------------
I've created a pull request that fixes this bug
https://github.com/droolsjbpm/drools/pull/73
> 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