bloqhead
11/12/2013 - 8:48 PM

acf-price-format.php

<?php
/**
 * Price Format
 * $4.50 => $4.5, $10.00 => $10, etc.
 * Assumes you have the ACF plugin installed
 * Yo dawg, I heard you like rtrim()...
 */
$price = get_field( 'price' );
$price = str_replace( '$', '', $price );
$price = rtrim( rtrim( number_format( $price, 2 ), '0' ), '.' );
?>