10-19-2011 04:43 PM
Is there a way to get floating-point numbers to use the locale-specific decimal separator in the Fmt() function?
It appears that SetSystemAttribute will only change the separator for UI elements, as described in this thread. Calling setlocale(LC_ALL, "") doesn't seem to be working either.
Is this possible?
Solved! Go to Solution.
10-20-2011 01:46 PM
Ron,
I dont think there is a valid locale-specific-separator you can send the fmt function, but a very simple workaround would be to convert what youre looking at to a string, and swap the period for a comma if they are in the proper locale. The setlocale can be used to read locale settings in windows I believe, if you need to check for those.
Regards,
Kyle Mozdzyn
Applications Engineering
National Instruments
10-21-2011 08:22 AM
Thanks for the reply. I ended up just doing a search and replace and swapping every instance of Fmt() with sprintf_s(), which DOES pay attention to setlocale().
10-24-2011 08:33 AM
Ron,
Thats great to hear you got it working, and thanks for posting your solution. Learn something new every day!
Regards,
Kyle Mozdzyn
Applications Engineering
National Instruments