03-18-2013 01:53 PM
Hey everyone,
I'm brand new to LabVIEW, and just learning how this all works. I was wondering if there was a way to allow user input to modify the number of decimal places (The output of my function is infinitely repeating).
I tried this, but it didn't work:
Using a numeric input, I concatenated a string with "%." + "[INPUT]" + "f" using the number to string functions and the concat strings function. I used the resulting string as the Format String in the format value function.
This doesn't work though. The output should be something like "28.274", but instead, it outputs "283f". Does anyone know why? Is there a better way to do this?
Also, attaching an image of the block diagram and front panel for clarity.
(Yes, this is homework, but the assignment does not include allowing the user to adjust number of decimal places, it's just something I'd like to add.)
Solved! Go to Solution.
03-18-2013 02:09 PM
03-18-2013 02:11 PM - edited 03-18-2013 02:12 PM
Get rid of the number 2 for the width of your number to decimal string. It is forcing a space in front of a single digit number. %. 6f is not equal to %.6f. The format into string doesn't quite understand the first format string.
(PS. It helps if you attach your VI. That way we can play with what you have rather than trying to recreate it from scratch.)
03-18-2013 02:38 PM
Oh. Thanks! For some reason I assumed that it required an input on that node.
In the future, I will attach the VI. Why didn't I think to just do that in the first place? Anyway, sorry for the stupid question, and thanks for the quick replies. 😃