LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
MGiacomet

Fract/Exp String to Number function should handle "thousands" separator

Status: Declined

Any idea that has received less than 4 kudos within 4 years after posting will be automatically declined.

This function already handles alpha characters such as the plus and minus signs, "e", "E" and the localized decimal point. It should also be able to handle the "thousands" separator (in the US, the comma).

 

Currently, if the string is "2,000,000" it returns simply "2". Ouch!

4 Comments
LordNobady
Member
The problem is that the comma is a decimal separator and the point is the thousands separator. ( in this part of the world ) This difference makes it difficult to implement.

Learning LabVIEW since January 2013
GerdW
Knight of NI

This would create the same beast as the opposite function of converting numbers to strings: you need a lot more inputs to define all prerequisites: which kind of decimal separator, kind of thousands separator, which kind of separation at all (some prefer grouping with two or 4 digits)…

 

I don't like that idea. Use either standard floating point formatting (without any thousands separator) or use scientific formatting (again without thousand separators)! When you need some "special" formatting by user request: write your own conversion routines!

(If you think it could be useful for all mankind LabVIEW users: create a packed library and sell it on LabVIEW tools networks! That's the easiest way to check it's importance… :D)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
MGiacomet
Member

LordNobady and GerdW: The function ALREADY handles decimal separator according to the Operating System localization, if you choose it to do so. If NI were to fully implement handling of numbers as strings (in this case the thousands separator) and you didn't like it, then you'd still be able to make it not do it for you.

 

(No, I can't change the way the input is formatted: I'm parsing someone's else data and can't make them change it.)

 

 

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 4 kudos within 4 years after posting will be automatically declined.