LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Swimmer

Expand the polymorphic capability of the Decimal String to number Function

Status: Declined
Functionality already in LabVIEW. Fract/Exp String to Number VI.


LV Code Snippet 1.png

This looks nice doesn't it.  It appears that the value output from the Decimal String to number function would include the decimal and fractional parts of the number 123.456.

But as you can see, and it is stated in help, this function returns an integer.  It allows you to manipulate the data type but this is only for convenience.

 

I suggest changing this function to include changing the string to the data type wired.  Or add functions that converts to the other numeric types and include the fractional portions of the string value wired to the function.

6 Comments
JackDunaway
Trusted Enthusiast

Rather than improving any feature on the "String/Number Conversion" Palette, I would contend you're going to be more successful long-term using the Format Into String function. That entire palette's functionality plus much more can be achieved by knowing some Format Specifier Syntax.

Swimmer
Member

Agree'd that the work around is to use the "Scan From String" function not "format into string" function and that is what I'm doing now, but I contend that this vi appears to be capable of doing something that it can't.  

 

So my opinion is that they should either change it so it puts out an integer or change it so that it converts the string value per the wired data type.

JackDunaway
Trusted Enthusiast
Oops, you're right, Scan From String rather than Format Into String, backwards interpretation on my part. "but I contend that this vi appears to be capable of doing something that it can't." Yes, such is the case many-a-time when a more sophisticated VI is wrapped into an "easier to use" API.
GregR
Active Participant
You don't have to switch to "Scan From String". Just a few items past "Decimal To Number" in the palette is "Fract/Exp String to Number". It is very similar to "Decimal to Number" but handles numbers with a fractional portion. You can still make an argument for one node instead of two, but the functionality is there.
Swimmer
Member

How nifty.  I should have noticed that.  Thanks.

Funny thing is I created this post at the suggestion of NI.  

Apparently they didn't notice it either.

 

 

G-Money
NI Employee (retired)
Status changed to: Declined
Functionality already in LabVIEW. Fract/Exp String to Number VI.