I want to add a discount percentage using Dynamic Data

Hi, I want to use a jetengine meta {cf_static-price} & woocommerce regular price {woo_product_regular_price:value} dynamic data to create a discount percentage.
I tried following using code element but it shows an error.

<?php $x="{cf_static-price}"; $y="{woo_product_regular_price:value}"; echo(ceil((($x-$y)/$x)*100)); ?>

How can I able to get to do that?

You need to put the calculation in a php function (plugin or functions.php)
function some_name($my_post_id) {
get the meta using the $my_post_id
do the calculation
return $result;
}
And where you want the number put {echo:some_name({post_id})