LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the "Format & Strip" function not return a number in the same format as "Format String"?

I am using the "Format and String" function in a vi with the "string" input wired to a string of type "0.9998,0.9899,1.0003,0.9995, (etc)". I have wired the "format string" input to a string constant "%1.4f". Irrespective of the format string, I always get a number out that is rounded to 2 decimal places. I have tried different number formats in the format string, and I have wired a 4d.p. floating point number to "default". I have also set the precision of the format string to 4 d.p. with no effect. Any suggestions (or is the output always rounded to 2 d.p.)?
0 Kudos
Message 1 of 3
(2,979 Views)
Hi,


If you are looking at the result in a numeric indicator, then the default setting is 2 places of decimal, that is displayed.

You need to right click on the indicator and select Format & Precision then change the Digits of Precision value.


Ray.
Regards
Ray Farmer
0 Kudos
Message 2 of 3
(2,979 Views)
Hi Ray,

Thanks for the answer! Viewing the results through an indicator has worked. I forgot to mention beforehand that I was watching the variables using the "Highlight Execution" option and just viewing the variables as they exited the vi.

For some reason the variable out of the vi is 2dp formatted for the display, which is a bit strange considering all the other variables in and out appear in their correct format.

Bizarre!

Thanks again

Jonbob
0 Kudos
Message 3 of 3
(2,979 Views)