Andreschrosa Posted January 28, 2009 Share Posted January 28, 2009 I'm using DAQFactory to store data into a MySQL database and then I query from this database and use create a csv file. However in the process, my data is losing it's decimal delimiters. I know I can change it from "," to "." on windows' regional settings, but short of it, is there other way of changing it? I must use "," as decimal delimiter. Link to comment Share on other sites More sharing options...
AzeoTech Posted January 28, 2009 Share Posted January 28, 2009 The comma vs decimal is just the presentation of the number. The data is stored internally in IEEE double floating point values. I'm unclear where you need it represented with a comma. DAQFactory only support decimal representation by default because using a comma inside a number affects the various script parts that use a comma for something else such as the for() loop or array {} and [] notation. I believe there is a way to use the format() function to display a number with , as the decimal point. Link to comment Share on other sites More sharing options...
Andreschrosa Posted February 3, 2009 Author Share Posted February 3, 2009 My problem with the decimal notation is the regional settings in windows for our country uses coma as the decimal delimiter. So when I export the channel's readings from DAQFactory to MySQL database it goes well, but when I get the data from the database and export it to a CSV file (using ";" as a separator instead of coma, again bacause of the regional settings), all the numbers lose their notation. Link to comment Share on other sites More sharing options...
AzeoTech Posted February 3, 2009 Share Posted February 3, 2009 So the problem is trying to get data from MySQL back into DAQFactory through a CSV file? Why not just read the database directly? Link to comment Share on other sites More sharing options...
Andreschrosa Posted February 3, 2009 Author Share Posted February 3, 2009 When in mysql the data is alright, when I select it into DAQFactory it's still alright, the problem is when I send it over to the CSV file, it loses it's format. I also tried without sucess to make then into strings and substitute the "." by a "," before sending then to the file as doubles again... if I do change the regional settings to use coma as decimal separator, then it works. What I am trying to evade is to ask our users to have their windows regional settings set to non standard as it (may) cause other incompactibility. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.