LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric Display Format for European Comma

I'd like to display a numeric indicator with a comma for the decimal point when used by European customers and a decimal point in the US.  The display format will be decided with a toggle and changed programatically. 
 
For example:  1.21 for US and 1,21 for Europe.
 
I only want to apply this to the indicators on the front panel (not when reading or writing files).
 
Is there a format/syntax that I'm missing in the indicator properties?  I tried the "%,;" syntax, but it bounced.
 
Any help is appreciated.
0 Kudos
Message 1 of 12
(4,729 Views)
Hi SJT,
you can use a string indicator.
Mike
0 Kudos
Message 2 of 12
(4,728 Views)


@SJT wrote:

Is there a format/syntax that I'm missing in the indicator properties?  I tried the "%,;" syntax, but it bounced.
 
Any help is appreciated.


After the %,; you should append the normal formatter, like %f or %d.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 12
(4,726 Views)
Thanks for the quick responses.  I'll be more specific by uploading sample code.  This code does not actually work and creates an error. 
0 Kudos
Message 4 of 12
(4,722 Views)
What is the localized setting on your PC?
0 Kudos
Message 5 of 12
(4,709 Views)

If you can use a string indicator as Mike suggested, then see the attached example which shows a couple of ways of accomplishing this.  They both do the same.

This method will not be affectd by the localization setting on your PC.

RayR

 



Message Edited by JoeLabView on 06-28-2008 09:20 AM
0 Kudos
Message 6 of 12
(4,707 Views)

Joe,

The settings on the PCs will vary depending who installs the program:  some in US, some in Europe.

I'd like to avoid converting to strings, if possible.  So I'm holding out for a property node change on the numeric indicator itself.  If there's no simple solution that I'm missing, I'll go to more elaborate solutions. 

Any more advice??

0 Kudos
Message 7 of 12
(4,703 Views)
By default, all numeric indicator and controls automatically display with the correct localized settings, so there is really nothing to do.
 
The corresponding LabVIEW.ini setting is:
 
useLocaleDecimalPt=True
 
(and is assumed to be TRUE if missing).
 
If your program is installed on a German computer, it will show a comma and if it is installed on a US computer it with show a decimal point. What else do you want? 🙂
0 Kudos
Message 8 of 12
(4,686 Views)

OK.  That would be great.  Do the local settings only apply to front panel display indicators or will it affect how data is written to an Access database, Excel and other text files?

Thanks for your help.

 

0 Kudos
Message 9 of 12
(4,667 Views)
I would think that excel and databases use localized settings but LabVIEW has no control over this. The underlying data is the same and the display is just a cosmetic property implemented by the program that displays the values.
 
LabVIEW does have control over how formatted text files are written (and that includes text files and  "spreadsheet" files). This will cause a problem if for example files are exchanged between computers with different localized settings. I would strongly recommend not to use localization for formatted text files. Still, you can overwrite the default behavior by changing to the "other" seperator. To write a spreadsheet file in the US with a comma as decimal sperator, use a format of "%,;%.3f" for example.
0 Kudos
Message 10 of 12
(4,660 Views)