LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting decimal string with comma seperator to decimal

I am reading in a file as a spreadsheet string and am having problems with numbers such as 1,450.  When I convert this from spreadsheet string, seperating by tab delimination, to decimal I end up with the number 1.  Any idea on how to make the conversion see that 1,450 should convert to 1450?

Cheers
0 Kudos
Message 1 of 3
(2,816 Views)
So the comma seperator is a thousand seperator?
If so  use the following format string: '%.;%f'  (there's a . (dot) between the % and the ;))

IMHO every piece of software that store data witha a thousand seperator should be send to the eternal realms of floppy disks and be magnetized

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!
Message 2 of 3
(2,806 Views)
I don't understand the solution given above, because it does not work for me.
 
Sure %.; will switch the decimal seperator to period, this still does not mean that it will skip over the "," when reading 1,450. It will still read only the 1 because anything that is not part of a decimal string will terminate the number field.
 
I would just do a global replace of all commas with nothing and then convert to an array. (LV 8.0). Now %f will work just fine.
Message 3 of 3
(2,784 Views)