I extracted this$number = 100000.5;
from the database.
What I need is to set the format to100.000,5
str_replace
number_format
I guessed it.
My replacement worked perfectly,
echo str_replace('.', ',', $row['anskaf_sum']);
(return: 100000,5) But when I add number_format I somehow fail
number_format($row['anskaf_sum'] , 0, ',', '.');
return
101
I've tried a few other approaches but I can't seem to get close to the answer I need
Thanks.
Are you sure your $row['anskaf_sum'] doesn't contain values you don't expect? because:
...this will return the result you want: 100.000,5