In the website, I enter a number like “1.23*^25” in the input field and hit ENTER. I expect a return of “1.23e25”. In fact, the return is an image in which “x Slot” is written.
I have tried various permutations of wrappers like FortranForm, CForm, NumberForm, and so forth, and various other attempts with Delayed, none of which gives the desired result. To be clear, I don’t want to get back an image (e.g., as possible with ExportForm[ ]). I would just like to get back a simple string such as “1.23e25”.
[In the absence of any wrapper, the return is: ’ 12300000000000000276824064’. Hence, there is a need for a wrapper.]
By the way, here is a non-elegant workaround. This solution essentially duplicates the work of NumberForm. After looking at some of the codes generated by CloudDeploy, I see that the ‘processor’ strips out all formatting wrappers, no matter how hard I try to keep them in. So here is a workaround below. I’d be interested in someone else’s more elegant solution.
An additional nice format that uses superscripts instead of “E” notation can be obtained within many FormPage[ ] results by using the HTML mixed expression below in place of the corresponding line in the function above:
This is because FortranForm, CForm et al are not properly functions, they don’t evaluate. As a matter of fact they just change the out cell in the frontend. Same goes for InputForm, FullForm, TraditionalForm. Because of that they mostly just work in the frontend.
In order to achieve what you want you’d need to use ToString with two arguments: