Forum Moderators: coopster
Using str_replace like this takes all the 0's away and leave 60 as 6...
$row["comision"] = str_replace("0.00", " ", $row["comision"]);
In this exampel the hundred values works perfect but in case thousands 1000.00 it leaves me with 100
if ($row["comision"] == 0.00)
if ($row["pagado"] == 0.00)
{$row["comision"] = str_replace("0.00", " ", $row["comision"]);}
{$row["pagado"] = str_replace("0.00", " ", $row["pagado"]);}
Any clues what to do to not show the amounts if it is 0.00?
Thanks in advance
In the { } I used str_replace and works perfect.
if (substr($row["comision"],0,2)=='0.')
{
{$row["comision"] = str_replace("0.00", " ", $row["comision"]);}
}
if (substr($row["pagado"],0,2)=='0.')
{
{$row["pagado"] = str_replace("0.00", " ", $row["pagado"]);}
}
I was searching in mysql and didnīt find it,
anyway I had problems with the sums and substracting when there was no amount in one of the fields, so I think I need the value 0.00, so I prefered not to toch the select, but I suppose the replace would work as well.
Anyway it is done and works.