12-26-2012 05:42 PM
Dear fellow Labview users,
I'm quite familiar with Labview but for some reason I cannot figure out how to do the following:
I need to format a number (any number given) into a string of the form 'mmmmee' where m is a digit and 'ee' the exponential. For example:
0.0128 becomes 1280-5
1654086 becomes 165403
0.0000006 becomes 0600-9
etc.
I would appreciate any advice.
Thank you!
Solved! Go to Solution.
12-26-2012 06:38 PM - edited 12-26-2012 07:22 PM
Here's a quick draft. I am sure some of the regex wizards will come up with something simpler. 😄
It sitll needs some work. For example if the value is zero or negative, or if the resulting exponent is more than 2 digits, you also need extra handling. I currently deal with negative exponents that are more than 1 digit (i.e. 2 digits, including the sign).
12-27-2012 08:10 PM
This is great! Thank you! Works perfectly. I added the additional filtering.