3
I built a server with Centos 7, SQL Server 2017, and Unixodbc
On tsql, the numbers are correct.
But when I see in isql, the decimals are separated by a comma (,) rather than a dot (.).
How can I fix this problem?
P.S.: What I really want is to use the number in PHP (you are complaining that the number is with formatting problem)
UPDATE: The error that appears in PHP is: Notice: A non well Formed Numeric value encountered in /usr/share/Nginx/html/loja3/info_vend/achapeca.php on line 789
I saw now that the error occurs when using php number_format
UPDATE 2:
I ran the var_dump and Windows returned: string(12) "3.5 million" No Centos: string(3) "3,5"
UPDATE 3:
It seems that the solution is to remove number_format. But I find it strange because it needs number_format in Windows and Centos not. Any additional verdict or tip?
can show us an example ? where the commands are being executed ?
– Rovann Linhalis
Note that SQL Server 2017 is not yet the final version. For now only CTP (Community Technology Preview) is available. It is for testing. See https://blogs.technet.microsoft.com/dataplatforminsider/2017/05/17/sql-server-2017-ctp-2-1-now-available/
– José Diz
Yeah, I know the version is a preview. But as in sqlcmd and tsql is ok, I imagine the problem is some configuration that impacts odbc but does not impact sqlcmd, or tsql An example, in tsql, a number appears as 22.40 and in isql appears as 22.399999999999
– Claudio Shigueo Watanabe
@Claudioshigueowatanabe: How is declared in the database the column that displays value 22.40?
– José Diz
An example of such a field is decimal(15,2). From what I saw, the fields that are giving problem are all decimal
– Claudio Shigueo Watanabe
Make a
var_dump
just to see and please is very important that puts the complete error message that occurs in PHP here to see. Just for the record, you see the comma in the isql, but it doesn’t mean it’s real comma it’s just a way for the isql to make it easier to read, in the bank this normal.– Guilherme Nascimento
The error that appears in PHP is: Notice: A non well Formed Numeric value encountered in /usr/share/Nginx/html/loja3/info_vend/achapeca.php on line 789
– Claudio Shigueo Watanabe
I saw now that the error occurs when using php number_format
– Claudio Shigueo Watanabe