Page 1 of 1

thousand seperator prob

Posted: Mon Feb 20, 2006 2:27 am
by joecrack
i usually use this code to get the number format that i want:

Code: Select all

$jan['to_sam_jan']=number_format($jan['to_sam_jan'],2, '.', ',');
But when i get my data like this:

Code: Select all

echo "</tr>";
  while ($row = mysql_fetch_row($ergebnis)){
    echo "<tr>";
    for ($i = 0; $i < mysql_num_fields($ergebnis); $i++){
      echo "<td align=\"center\">$row[$i]</td>";
    }
    echo "</tr>";
I dont know how to include the "number format" in there!?!:?
Anyone got an idea?

Posted: Mon Feb 20, 2006 2:29 am
by feyd

Code: Select all

$row[$i] = number_format(yadda,yadda);
:?:

Posted: Mon Feb 20, 2006 2:36 am
by joecrack
sorry - i didnt tel you that there is a bunch of data comin in one $row.
so if i do it like that - also for example the 'date' fields that i have in it will change.
i could look in every row for numbers that are like #####.## and only change those ....
with array_search - but how can i look for those types?