Dropping this more as a solution, but would love to see a better productized resolution as well.
I have run into issues where I need non-rounded values returned in my rule results, but there is no way to truncate or force that behavior within any of the data or transformation tasks. Even if you push a value with a decimal into a field with no decimals, it will still round based on normal math rules (4 or less is down, 5 or more is up). Examples of data this affects:
- Time, especially when thinking about hourly billing (if I needed to convert from seconds to a HH:MM:SS format)
- Curreny
- Date differences
However, I have found a way to capture that value within an MDA table, which may result in needing more than one rule to realize the solution, but offers flexibility with data types and results.
You will need:
- Fields [list]
- These will come in pairs [list]
- One for the decimal value
- One that is a calculated field [list]
- You will need to do an advanced formula, using the below CASE statement [list]
- CASE WHEN "FIELDNAME" >0 THEN trunc ("FIELDNAME") ELSE 0 END
- One rule to calculate the decimal value and push it into the MDA table
- One rule to perform your actions based on the value captured in the calculated field