LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing exponential string with two-digit exponent

I have to create a text input file with a very specific format from LabView, the numbers to be expressed in exponential notation with a two-digit exponent term, padded with a leading zero if required(i.e. 1.2345E+01 instead of the LabView default 1.2345E+1) I was wondering if anyone had found a built-in way to do this, or if I need to write my own string modification function. Thanks!
0 Kudos
Message 1 of 3
(3,748 Views)
No dedicated LV function to do that. But the solution is not very complicated. See the attached vi.
May be this time, I'll be the first to answer (private joke :))
Chilly Charly    (aka CC)
Message 2 of 3
(3,748 Views)
Thanks, I was afraid of that. As I have several of these files to write, I extended the VI to take in a requested precision, exponent width, and total width, similar to the LV built-in number-to-exp-string function. It returns the string and the length of the string(which will overun the requested width if required to meet the requested precision). It's attached in case anyone else is looking to do the same thing. Thanks for you help!
Message 3 of 3
(3,748 Views)