How to work with Formulas in AX 2009

Hi guyz;

Am new in AX and am wondering whether there is a class in AX that manages formulas.

For instance in NAV there is a function that handles user created formulas such that if

i pass the formula (15/100)*3000 it will return the calculated figure of 450

Is there a similar functionality in AX which i can use.

hai,

am also new & not that much femilier as of i understand, i just write a sample code see the below

static void BODMAS(Args _args)
{
int x = 15;
int y = 100;
int z=3000;
int r = x/y;
int s=r*z;
;
print “s value is :”,s;
pause;
}

then we will get the correct Answer.

Thanks & Regards

i don’t understand need for a class.

The system it self will calculate. suppose you put this in form control (Real or int) or a table field it will return you the result. and you can directly place it in code the Ax will calculate.

Display method is a good option for calculate and display the out put wherever you want form or report.

but again it depend on your exact requirement.

it will batter if you can explain which field you want and where do you want to display the output.

thanks all for the response.

i should clarify that i wanted to allow users to specify a formula which

should be a string then have the system do further calculation using the string formula and return results

i found this function which so far seems to work for me formattedstr2num().