Home › Forums › General Issues › Number field › Reply To: Number field
For anyone else wondering …
I needed to show long decimal latitude and longitude values (e.g. 53.234567) to 2dps on the front end (53.23).
This worked for me.
<?php
$output = get_field('latitude_metric');
$latitude = round($output, 2);
echo $latitude;
?>
Hope it’s of use.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.