I have to transform values like:
3200
5000
10000
13000
100000
in
3.200
5.000
10.000
13.00
100.000
I tried to use the number_format
function of PHP
but could not do it correctly. How can I resolve this problem?
I have to transform values like:
3200
5000
10000
13000
100000
in
3.200
5.000
10.000
13.00
100.000
I tried to use the number_format
function of PHP
but could not do it correctly. How can I resolve this problem?
You can elaborate as follows:
function formata_valor($valor){
if($valor!=NULL){
echo number_format($valor, 0, ',', '.');
} else {
echo "Nenhum valor foi preenchido.";
}
}
echo formata_valor("10000"); // output 10.000
Reference documentation: link