I want to read a string and convert it to a number with the string being in the form 2.000000E+00, add some number to it, and convert it back to a string in the same format. I can read the string and convert to a number okay, I am just unsure from the help files how to convert it back to a string in this specific format. Using "Number to Exponential string" gives me the correct number in almost the correct format, it is merely missing the extra number in the exponential.
2.000000E+00 -> string to number -> add 0.5 -> number to string -> 2.500000E+0
The last zero is missing which I need for stage position commands. I can edit the string to add it but as the position values will vary, how the string gets edited would not be consistent. I preferably need a way of converting any number into this format.
Solved! Go to Solution.
Sorry I think I didn't explain myself properly. The number of zeroes after the decimal point is fine, it is the number of zeroes specifically after the letter "E" that is wrong.
There is no format specifier for that. You could always manipulate the resulting string to add zero if necessary.
Yeah that's what I meant in the question, the numbers would vary in such a way I'd need to build multiple cases to deal with it but oh well.
Here is the solution I came up with. Not exactly pretty, but it works.