I am working with a function that returns output in AccountingForm format. I would like to do math with that output, but Mathematica does not recognize it as numbers. Is there a way to convert a number in AccountingForm back into a real number?
x1 = 23.3;
x2 = AccountingForm[x1];
2*x2 (* does not compute *)
various things I have tried . . .
2*NumberForm[x2, 2] (* does not compute *)
2*N[x2, 2] (* does not compute *)
2*Apply[Real, x2] (* does not compute *)
2*ToExpression[x2] (* does not compute *)
Thanks
x2=x2[[1]]which gets rid of theAccountingFormhead. – N.J.Evans Feb 15 '17 at 19:09*Formformat functions raise the same issue, so it really is the same essential question. The best answer really is don't do that in the first place.. – george2079 Feb 15 '17 at 21:48