CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

SQLSRV driver returns decimals without leading zero

Open daveherman71 opened this issue 3 years ago • 1 comments

daveherman71 avatar Jul 25 '22 11:07 daveherman71

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
		);

daveherman71 avatar Jul 25 '22 11:07 daveherman71