Symptom
After upgrading the Frame Agreement Manager (csfam) package to R36 MR3, negotiation levels in the Frame Agreement UI display the last decimal digit one lower than the correct value.
Example: For a product with base price 50.2482 and discount 8.5529:
- Expected: 41.6953
- Actual (R36 MR3): 41.6952
The issue affects both the UI display and the value saved to the database. It does not occur in environments with the pre-MR3 package version.
Cause
R36 MR3 introduced a change to the internal rounding function used for all numeric calculations in the Frame Agreement UI. The function was changed from Math.round (correct rounding) to Math.floor (truncation toward negative infinity) for positive numbers.
This means that when floating-point arithmetic produces values like 41.6952999..., the function truncates to 41.6952 instead of correctly rounding to 41.6953.
The change was originally introduced to fix rounding for negative numbers, but it inadvertently broke rounding for positive numbers.
Resolution
Install the patch release
Install the patch that corrects the rounding logic:
For R36 MR3: csfam version 36.36.3
/packaging/installPackage.apexp?p0=04tJ5000000gR5G
For R38: csfam version 38.0.3
/packaging/installPackage.apexp?p0=04tJ5000000opex
Verify the fix
After installing the patch:
1. Open a Frame Agreement with negotiation levels
2. Verify that the decimal values now display correctly
3. Check that existing negotiations saved with the incorrect values are recalculated on next access
Additional Notes
- This patch only addresses the decimal rounding issue -- no other changes are included
- The fix uses
Math.floor(adjustedValue + 0.5)which correctly rounds both positive and negative numbers - If you have previously saved negotiations with truncated values, they will be corrected when the negotiation is recalculated through the patched code
Priyanka Bhotika
Comments