CodeIgniter
CodeIgniter copied to clipboard
SQLSRV driver returns decimals without leading zero
The SQLSRV driver returns decimals and money fields without the leading 0.
To fix this we require the FormatDecimals parameter to be passed in the sqlsrv_driver.php file.
$connection = array(
'UID' => empty($this->username) ? '' : $this->username,
'PWD' => empty($this->password) ? '' : $this->password,
'Database' => $this->database,
'ConnectionPooling' => ($pooling === TRUE) ? 1 : 0,
'CharacterSet' => $charset,
'Encrypt' => ($this->encrypt === TRUE) ? 1 : 0,
'FormatDecimals' => 1,
'ReturnDatesAsStrings' => 1
);