-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Description
Description:
Using double/float input data to execute a dmn decision table, the double/float input got prevcision loss。
Version:
Flowable Version: 6.5.0
Code:
code snippet in ELExecutionContextBuilder.java
} else if (inputVariableValue instanceof Double ) {
BigDecimal transformedNumber = new BigDecimal((Double) inputVariableValue);
inputVariables.put(inputVariableName, transformedNumber);
} else if (inputVariableValue instanceof Float) {
double doubleValue = Double.parseDouble(inputVariableValue.toString());
BigDecimal transformedNumber = new BigDecimal(doubleValue);
inputVariables.put(inputVariableName, transformedNumber);
}
Additional comments:
i think the best way is using BigDecimal.valueOf(val) or new BigDecimal(Double.toString(val))
Metadata
Metadata
Assignees
Labels
No labels