on 2020 May 20 3:25 PM
SAP MII Version: 15.2 SP3 Patch 8 (Mar 20, 2019)
Scenario: I'm retrieving 2 values do a calculation and if the calculation is negative throw an error.
Issue: for certain values the calculation returns '-0' and handles it as a negative number. As I'm retrieving my values from a custom SQL action block the values are text.
Expected behaviour: the first expression should return '0'. The second expression should return '0' or 'false'
Did somebody else experience this behaviour? Does someone know if this is fixed in later patched?
Request clarification before answering.
In SQL Server and many databases, the float or double numbers are actually expressed as functions of binary. So if you have values to the right of the decimal point, it does not exactly equal the number displayed. It extends much further to the right. If you want to see the desired results, then use the format function with 3 decimal places (or 4 or 5 or whatever makes sense in your scenario). One can do that to the individual numbers or to the full equation.
If you have access to the database, you can also do a select on a float field and see what the number is in response. It may be a little different than you expect. -0 simply means the value does not fit within the specific number of decimal places for the value returned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.