Try this (maybe my formula is not correct, place the () as you want)
{
ExecutePermission permission;
str formula = '%1+%2*(%3/%4)/(%4*%5)';
real a,b,c,d,e, value;
a = 1;
b = 2;
c = 3;
d = 4;
e = 5;
// Insert value in formula, deletes all '.' and replaces ',' with '.'
formula = StrReplace(StrRem(StrFmt(formula,a,b,c,d,e),'.'),',','.');
print formula;
permission = new ExecutePermission();
permission.assert();
//BP deviation documented
Value = evalbuf(formula);
CodeAccessPermission::revertAssert();
print value;
pause;
}
I'm not sure the deleting of '.' and replacing of ',' with '.' is needed for
you, but in Denmark '.' is thousand separator and ',' is decimal point, and
evalbuf doesn't like that.
Regards
Jan Stelsig Dahlsgaard
Fujitsu - Denmark
________________________________
Fra: [email protected]
[mailto:[email protected]] På vegne af naveed ali
Sendt: 3. marts 2009 13:40
Til: [email protected];
[email protected]
Emne: [development-axapta] Mathmatical Expression in ax
Hi,
I have mathmatical expression like a+b(c/d)/(d*e).
My problem is how to save it in database table and reterive to perform some
mathmatical operation.All these varaibles have some fixed values which is
stroed in another table.
Any help regardig this.
Regards,
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]