<?php $price = get_post_meta( get_the_ID(), '_price', true ); $regular_price = get_post_meta( get_the_ID(), '_regular_price', true ); $sale_price = get_post_meta( get_the_ID(), '_sale_price', true ); // "Saving Percentage" calculation and formatting $precision = 1; // Max number of decimals $saving_percentage = round( 100 - ( $sale_price / $regular_price * 100 ), 1 ) . '%'; ?>