SAP Knowledge Base Article - Public

3504060 - False calculation observed in the ironpython script workbench

Symptom

The IronPython scripts are not able to retrieve decimal values as results.

Environment

SAP CPQ SALES CLOUD

Reproducing the Issue

  1. Open the CPQ script workbench
  2. Execute this script a = 2/3
  3. Observe the result as 0.

Cause

The system is working as designed.

Resolution

To obtain an accurate result, you can try using the .0 in your numerator followed by the numeric value.

For instance, use 2.0/3 instead of using 2/3.

Keywords

incorrect result, decimal values, script workbench, wrong result, iron python script, decimal value, floating result, decimal result, false calculation, calculation , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To

Product

SAP CPQ all versions