Hi,
I have a job
static void Job297(Args _args)
{
RealBase t1,t2,t3;
t1=0.0833;
t2=1/12;
t3=t1-t2;
info(strFmt("%1",t3));
}
the answer is -0.0
Why-may i know why it shows negative value
How to get rid of neagtive value
I tried with
t1-rounddDecup(t1,3) -even though the value is 0.00 in info log , in table it gets saved as -0.0
From where do AX takes the negative sign
Hello NDingankar22,
That is not AX fault!
t2=1/12 is actually 0.0833333333333333.
You are trying to subtract 0.0833 with a higher number, which is why the negative sign appears.
You are working with real numbers, if you want to get the result 0.000 try to hardcode your variables to 4 decimal points.
All the best!
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156