Welcome Guest, Not a member yet? Register   Sign In
Leading zeroes to decimal value less than one
#3

(01-07-2022, 06:58 PM)kenjis Wrote: Now CI4 has no PDO drivers.

> MSSQL via the SQLSRV driver (version 2005 and above only)
Thank you Kenjis for quick reply.

I have found same param in sqlsrv as in pdo to add leading zero before dot and param for sqlsrv is FormatDecimals.

Below is the code working by directly putting option in sqlsrv connection class connect method of vendor :
PHP Code:
$connection = [
            'UID'                  => empty($this->username) ? '' $this->username,
            'PWD'                  => empty($this->password) ? '' $this->password,
            'Database'            => $this->database,
            'ConnectionPooling'    => $persistent 0,
            'CharacterSet'        => $charset,
            'Encrypt'              => $this->encrypt === true 0,
            'ReturnDatesAsStrings' => 1,
            'FormatDecimals'  => 1
        
]; 


As its not a way to have custom code in vendor so can you help if there is any other way to set FormatDecimals = 1 ?
Reply


Messages In This Thread
RE: Leading zeroes to decimal value less than one - by Sureshkumar - 01-10-2022, 02:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB