## PHP Driver version or file name
sqlsrv 5.3.0 PECL
## SQL Server version
SQL Server 2016 Standard
## Client operating system
Ubuntu LTS 18.04
## PHP version
PHP 7.2 - From official Ubuntu 18.04 repositories
msodbcsql17/bionic,now 17.2.0.1-1 amd64 (MD5sum: 0a13d93b2af7a0383f93d71448feb0a4)
We upgraded from the deprecated mssql PHP driver to sqlsrv. Our application is written in PHP + Symfony and uses Doctrine to communicate to SQL Server. The platform we are on is Ubuntu 18.04 (after upgrading). Everything works, except for zero decimal/float values. The issue is that the sqlsrv driver omits leading zeros. Values which are in the dabase 0.00 will be fetched as .00.
sqlsrv driver omits leading zeros in front of decimal/float values.
For example:
0.00..00 in PHP application.sqlsrv driver does not omit leading zeros.
Float/decimal values should be returned with leading zeros.
For example:
0.00.0.00 in PHP application.Hello @Jeeppler
This is by design and related to a feature request discussed in #415.
New configuration options to format outputs for decimal and numeric for both sqlsrv and pdo_sqlsrv have been recently implemented. Please stay tuned for the release of our next preview to try this out.
@yitam are you referring to this pull request: https://github.com/Microsoft/msphpsql/pull/861 ?
@Jeeppler we merged two pull requests (#861 and #873). The changes only applied to decimal and/or numeric types because they are always fetched as strings, unlike floats or integers, which can be fetched as numbers.
@Jeeppler closing this issue as it is closely related to #415