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

We are using codeigniter 4 with microsoft sql server 2016 and we fetch data having decimal values less than zero, zero before dot getting removed.

After analysis of issue able to find that issue with sql server and they added below option from version pdo_sqlsrv v5.6.0, Below code which works for core php :

Code:
$attrs = array(PDO::SQLSRV_ATTR_FORMAT_DECIMALS => true);
$pdo = new PDO("sqlsrv:Server=" . $hostname . ";Database=" . $database, $username, $password,$attrs);

But didn't found way to do same with ci4 i.e. applying PDO::SQLSRV_ATTR_FORMAT_DECIMALS => true.

Thanks in advance.
Reply


Messages In This Thread
Leading zeroes to decimal value less than one - by Sureshkumar - 01-07-2022, 05:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB