Hi 🙂
I have a text fields in ACF that is automatically populated from an external software.
Sometimes I receive the value in this way: 1000, sometimes in this way 1000.0. This I cannot change.
Is it possible to always format it in something like 1’000.00 in frontend?
I am rendering it in my template like this:
<p><?php the_field( 'value' ); ?></p>
Many thanks in advance!
EDIT: is not a text filed but a number field
You would need to use https://www.php.net/manual/en/function.number-format.php
$value = get_field('value');
$value number_format($value, 2, '.', ',');
echo $value;
Do I neeed to add this in my functions.php file?