LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug/strange behaviour in the Format Into String?

Solved!
Go to solution

I just cannot understand the behavior with this function. I just specify that the 2nd input needs to be a float. But it just does not generate such input! I even double clicked and checked the input settings. Looks ok. What is happening??

 

bug_in_format_into_string.png

0 Kudos
Message 1 of 4
(2,539 Views)
Solution
Accepted by topic author Blokk

I think Format Into String only cares if it is a numeric or a string. The formatting is up to you. You can format a DBL number as %d or format a U32 number as %f. The numeric inputs are polymorphic and will accept all types of numerics.

If you expand the node it will just use the last type as default for the next ones (e.g. if you have one U32 connected and expand the node, the default for the other numerics will be U32 as well).

Doesn't look like a bug to me.

 

Message 2 of 4
(2,533 Views)

@dan_u wrote:

I think Format Into String only cares if it is a numeric or a string.


Or a Boolean or an enum or a Timestamp (the last two are technically numerics, but the enum can be formatted into its string!).

 

Everything else dan_u stated I was going to say myself.  If you want to format a double, then you need to wire up a double.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(2,519 Views)

Thanks! For a strange reason, I thought I need to use this function like first specifying the "format string" input, and this function will "know" how to adapt to the data type.

 

But now it is clear, the inputs are just polymorphic.

0 Kudos
Message 4 of 4
(2,489 Views)