[eluser]Marcelo Reborn[/eluser]
(Sorry about the confusing title, I couldn't make it better)
- There's a big explaning -
This is my select statement
Code:
$select = '
id,
idc,
CONCAT( "R$ ", REPLACE(valor, ".", ",")) AS val';
...
$this->db->select($select);
...
This is the generated query string (note that a space "born" after the comma, inside the replace)
Code:
SELECT id, idc, CONCAT( "R$ ", REPLACE(valor,".",", ")) AS val,
Then, a monetary value that should be converted from
1.50 to
R$1,50, was converted to
R$1, 50.
I already figured out that this is caused by the Active Record class, which explodes all commas, and later, implodes them all with an space after:
Code:
$sql .= implode(', ', $this->ar_select);
(DB_active_rec.php, line 1512)
- Conclusion -
I just removed that space from implode() and my monetary values came back to normal.
I just want to know if CI crew would consider this a bug, because that spaces after the commas into an sql query are just "decoration".
Best regards from Brazil.