ODBC fetched float as strings with incorrect formats - by Jenny Tam

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


0
0
Sign in
to vote
ID 3132986 Comments
Status Resolved Workarounds
Type Bug Repros 0
Opened 4/25/2017 1:56:34 PM
Access Restriction Public

Description

By setting locale to French, retrieving a float value as a string from a database table shows both '.' and ',' in the number. For example, the value 3.14 will become "3.,14"
See https://github.com/Microsoft/msphpsql/issues/329 for the original issue.
Sign in to post a comment.
Posted by Microsoft on 5/19/2017 at 2:05 PM
This issue has been resolved.
Posted by Microsoft on 5/1/2017 at 10:09 AM
Since I couldn't replicate the problem that showed the comma in the floating point number, this might due the environment that I used to run the sample program.
Please also provides more details information about the environments.
1.) Is the customer running the sample program against a French SQL Server? What is the SQL Server version?
2.) It had been mentioned that the platform was Ubuntu 1604. Was the Ubuntu configured as a French version?
3.) What was the locale of Ubuntu 1604 which was used to run the sample program?
4.) Any additional information about the environment?
Posted by Microsoft on 4/27/2017 at 9:30 AM
I tried to replicate the problem using the Ubuntu 16.04 with the latest driver. I also used SQL_C_CHAR type to check for the results. The results were the same regardless of whether I set the locale to French or not. I didn't see the comma as mentioned.
Is it a typo in the expected result 3,14? Should it be 3.14? Please clarify. Could you provide the driver version?

Connected
dropped table
table created
value inserted
SQLExecDirect succeeded

------------------- Print Result -------------------
Record 1: ID=1, FloatingField= 3.1400000000000001

------------------- End -------------------
first digit fetched 51
second digit fetched 46
third digit fetched 49
fourth fetched 52
fifth fetched 48
sixth fetched 48

Thanks,
Sunny
Posted by Microsoft on 4/25/2017 at 2:49 PM
Thanks for reporting this Jenny. We'll look into it and get back to you soon.