Hi together,
I have the following calculation:
ri!timstamp(decimal)="1630391405000" if( isnull(ri!timestamp), todatetime(null), a!localVariables( local!hours: floor(ri!timestamp/1000/60/60), local!hoursMilli: local!hours*1000*60*60, local!tsMinusHours: ri!timestamp - local!hoursMilli, local!minutes: floor(local!tsMinusHours/1000/60), local!minutesMilli: local!minutes*1000*60, local!tsMinusMinutes: local!tsMinusHours - local!minutesMilli, local!tsMinusMinutes ) ) result 5000(decimal) if( isnull(ri!timestamp), todatetime(null), a!localVariables( local!hours: floor(ri!timestamp/1000/60/60), local!hoursMilli: local!hours*1000*60*60, local!tsMinusHours: ri!timestamp - local!hoursMilli, local!minutes: floor(local!tsMinusHours/1000/60), local!minutesMilli: local!minutes*1000*60, local!tsMinusMinutes: local!tsMinusHours - local!minutesMilli, local!seconds: todecimal(quotient(local!tsMinusHours, 1000.00)), local!seconds ) ) result 1805(decimal) - expected 5
5000/1000 results into 1805 instead of 5 and i absolutly dont get why it happens.quotient() gives the same result as I would divide it via "/"Any ideas?
Discussion posts and replies are publicly visible
Looks like in line 28 you have mistakenly done quotient on local!tsMinusHours instead of local!tsMinusMinutes. Correcting that should resolve the issue.
my hero.... thank you very much.-> two lead developers and one senior developer havn't seen this and this rule is productive since 2018.
haha it happens to the best of us! Glad I could be of help!