LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

decimal point format: period/comma

Hi guys,

 

 

I used the 'Format Into String' function. Here I edited the format string into '%.3f;', which means I tell labview to use a decimal point. But when I probe my formated string I see a 'comma'. I use labview 2010.

 

What is wrong here?

0 Kudos
Message 1 of 13
(49,959 Views)

what country is your computer set to? in europe this would make sense

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 13
(49,955 Views)

What? Belgium. Why it make sense in Europe?

0 Kudos
Message 3 of 13
(49,946 Views)

A few things:

 

  • Your computer has a language setting that defines the comma as decimal point.
  • Your LabVIEW installations is set to use localized decimal point, meaning the decision between comma and period depends on the language setting of the OS. (tools..options...front panel...general)
  • You can also overwrite this in code, e.g. using "%.;%.3f" as format string. This will give you a period.
  • For details, look for "localization codes" on the format specifier syntax help page (bottom of first table).

 

Message 4 of 13
(49,940 Views)

%.3f just tells LabVIEW to use 3 decimal places, it doesn't specify whether it is is decimal point or comma.

 

Look in the help file for format specifiers and then localization codes.

 

If you want to force it to be a decimal point use %.;  for a comman %,;

Message 5 of 13
(49,938 Views)
[quote]You can also overwrite this in code, e.g. using "%.;%.3f" as format string. This will give you a period.[/quote] Hello, can someone please give me an an code example how to use it. I stuck atm a bit. Tank you very much Thomas
0 Kudos
Message 6 of 13
(49,764 Views)

Hi Thomas,

 

In the Attachment you can find a small example. In the example there are two numbers and one is forced into a period and the other into a comma.

When you wire multiple inputs to the function, you also need to configure all of the inputs in the format string.

 

If you have further questions, don't hesitate to ask them.

 

Cheers,

 

Nico Lammens

National Instruments

NIBE AE

 

0 Kudos
Message 7 of 13
(49,681 Views)

Hello,

I've got a problem with the "Read From Space Delimited File" from this support link:

 

http://www.ni.com/example/25669/en/ 

 

The problem is that the values behind the decimal point are not copied into the final array, even though the indicator field "Spreadsheet string" on the front panel shows that the decimal values have been read correctly from the example text file. Can anyone explain why this is happening please?

0 Kudos
Message 8 of 13
(40,719 Views)

Hi Ribbster,

 

what have you tried so far?

What are your regional settings as described in the messages above?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 13
(40,713 Views)

thanks for the quick reply!!

 

• I have unchecked the box as mentioned before

 

tools>options>use localized decimal point (I live in Germany)

 

having done that, I tried to directly insert a decimal point into my final array, which didn't work, I could still only use commas.

 

• when I change the string format to %,3f for example, the final array is filled with zeros

 

It is weird. I should say that I use parallels desktop on mac OS. Does the example work on your computer?

0 Kudos
Message 10 of 13
(40,706 Views)