I’ve setup a Number field type (price field) and i’m trying to format the number value as:
10500 and a would like it appear as 10.500
<?php
$output = the_field(‘precio’);
$price = number_format( $output, 0, ‘,’, ‘.’);
echo $price;
?>
But it appear the same as without the number_format.
Any suggestion ?
the_field() echos the field value and does not return a value, you need to use get_field()
$output = get_field('precio');
$price = number_format( $output, 0, ',', '.');
echo $price;
I’ve setup a Number field type (price field) and i’m trying to format the number value as:
10500 and a would like it appear as 10.500
<?php
$output = the_field(‘precio’); VidMate
$price = number_format( $output, 0, ‘,’, ‘.’);
echo $price;
?>
But it appear the same as without the number_format.
Any suggestion ?
issue got solved!