LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fract/exp string to number with leading zeroes

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

0 Kudos
Message 1 of 3
(2,901 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 3
(2,893 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 3
(2,888 Views)