DataViewer and decimal point

Discussions about tools to complement CSPro data processing
AriSilva
Posts: 34
Joined: July 22nd, 2016, 3:55 pm

DataViewer and decimal point

Postby AriSilva » January 26th, 2018, 5:32 pm

Hi folks,
I´m having a problem with fields having embedded decimals.
Attached two files, one is the result of a data entry (csdb), and the other is a conversion to dat.
In dataviewer, looking to the csdb file, the fields latitude and longitude appear with the decimal point in the wrong place (see records 5 and 6). The proper values should be -23,xxxx
However, a frequency of these fields show them correctly.
And when converting the csdb to dat, the dataviewer shows the dat file as bad as the csdb (see dictionary attached).
By looking the .dat file in the notepad the decimal character is a dot, whereas my regional windows uses a comma.

Besides that, when capturing those fields with the gps function, and because of this confusion between decimal point formats, when the fields are displayed using %f in an errmsg format, they appear as notappl.
Definitely I am having a problem with the decimal point character.
Best
Ari
Attachments
Simple Capi.rar
(7.65 KiB) Downloaded 7 times

josh
Posts: 1339
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: DataViewer and decimal point

Postby josh » January 29th, 2018, 5:24 pm

The GPS coordinates in both files look correct to me in DataViewer. Even if I change my Windows settings to use comma as the decimal separator, the values are still correct in DataViewer.

Capture.PNG
Capture.PNG (127.68 KiB) Viewed 141 times


What are the values that you are seeing in DataViewer for latitude and longitude.

AriSilva
Posts: 34
Joined: July 22nd, 2016, 3:55 pm

Re: DataViewer and decimal point

Postby AriSilva » February 1st, 2018, 7:24 am

The problem might be in my regional settings.
In order to try to clarify the problem, I´ve attached a rar that contains the following:
1. The simplecapi application.
1.1 There, in function captureHH_Coordinates(), I just simulated the gps info, assigning some info to DD_LATITUDE and DD_LONGITUDE, as
DD_LATITUDE = -23.12345;
DD_LONGITUDE = -41.23431;
then I displayed that in the errmsg
errmsg("Latitude = [%f] \nLongitude = [%f]", DD_LATITUDE, DD_LONGITUDE );
And it came out like in the figure latlong.png (the values are shown as notappl).
2. I executed twice the data entry, and the result is in simplecapi.csdb.
2.1 When calling DataViewer for one of the records, it shows very huge numbers for lat and long, as in figure dataviewer.png, with no decimal values.
2.2 I executed a frequencies in this file, and it came out as in figure csfrqrun.tbw. The frequencies show the lat and long numbers as they were entered in the program.
2.3 I exported the csdb to the simplecapi.dat file, and there the lat and long data seems to be OK, the decimal point placement shows some decimal info.

I might had a wrong conclusion that the problem was in the gps capturing, but this example shows that the problem might be related with my regional settings.
But I cannot explain why the dataviewer shows he values with no decimals, and the errmsg did not "understand" the values being passed by, showing them as notappl?
Best
Ari
Attachments
SimpleCapi.rar
(77.39 KiB) Downloaded 5 times

josh
Posts: 1339
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: DataViewer and decimal point

Postby josh » February 1st, 2018, 8:54 am

What are your regional settings so that we can try to reproduce the issue here? Also what version of Windows are you using?

josh
Posts: 1339
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: DataViewer and decimal point

Postby josh » February 1st, 2018, 9:25 am

The errmsg issue is not related to the regional settings. It is because your call to errmsg comes before you get to the latitude and longitude fields. Since you are in system control mode, variables in the dictionary are notappl if they are skipped or if you have not yet passed through them. You can either call errmsg after passing through the latitude and longitude field or use the visualvalue function.

The DataViewer problem is a bug. We will fix it in the next release. In the meantime if you change your regional settings to one that uses a period for the decimal symbol or one that uses comma as the decimal separator but does NOT use the period as the digit grouping symbol it will work. I had previously tested using the default settings for French which uses the comma for the decimal separator but uses a space instead of a period for the grouping symbol so it did not have the problem. I just tested with Portugeuse which uses comma for decimal symbol and period for grouping and I am able to reproduce the issue.

AriSilva
Posts: 34
Joined: July 22nd, 2016, 3:55 pm

Re: DataViewer and decimal point

Postby AriSilva » February 1st, 2018, 3:44 pm

Thanks, Josh, for the explanation.
I thought that the errmsg problem was because of the decimal point also, but you clarified my problem very well.
I just had the errmsg there to try to find my problem of getting the gps values properly.
Best
Ari

PS. Just in case, I´m using Windows10 with Portuguese regional settings.


Return to “Tools”