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
$output = the_field(‘precio’);
$price = number_format( $output, 0, ‘,’, ‘.’);
But it appear the same as without the number_format.
Any suggestion ?
$output = get_field('precio');
get_field will return the field value, where as
the_field will echo it.
It would be great to be able to choose formatting of the number field (thousands separator, decimal places) both for the backend and the frontend.
Backend especially, since that’s hard to manipulate with PHP. It could be treated as a ‘Append’/Prepend’ option.
Hi, how to put comma separator into a field?
Please check my question at http://support.advancedcustomfields.com/forums/topic/can-not-input-money-value-in-number-field-type/
I would like to put money value in number field. Bellow are my required values
I need thousands separator in my number input value.
Can anyone help me please?
Try this code:
$num = get_field(‘your_field’);
$formattedNum = number_format($num).”<br>”;