01-28-2013 11:27 AM
Hi,
I have a section of my program where I convert a concatenated string to a number using the frac/exp string to number function. I cannot get the number to display correctly if the string's first character is a leading zero - instead it skips to the first nonzero number and then creates a decimal point and puts a zero at the end of the number. (For example, the string 011000000000 will display as 11000000000.0 when converted to a number) Is there a way to get Labview to display this/these leading zero(es)? They are important for monitoring my program.
I am attaching the loop in question where the conversion is done.
Thanks
01-28-2013 11:37 AM
To answer your question, the formatting is a matter of how the indicator is configured, not the string to numeric conversion.
A more general question however is, "What in the world are you trying to do?" My sense is that there are much easier ways of accomplishing your end goal. For starters, you could combine the individual boolean bits into an array, convert that array into a number and format the result.
Where are all the local variables coming from? You are using way too many...
Mike...
01-28-2013 11:46 AM
@mikeporter wrote:
To answer your question, the formatting is a matter of how the indicator is configured, not the string to numeric conversion.
A more general question however is, "What in the world are you trying to do?" My sense is that there are much easier ways of accomplishing your end goal. For starters, you could combine the individual boolean bits into an array, convert that array into a number and format the result.
Where are all the local variables coming from? You are using way too many...
Mike...
I was thinking the exact same thing. Easier to combine the booleans into an array and convert the array to a number. That way, you have an actual representation of the bits as a number that is much easier to manipulate than the "psuedo-number" that you get by converting the booleans to strings of 1s and 0s and combining them. Or, heck, just leave 'em as an array - it's a lot easier then to manipulate them at a bit level that way.