How to assign a variable to value field in meter tag of html

I have a tpl script(smarty template for php) in that I have added a meter tag and trying to assign a variable to value field in meter tag, but at the front end the meter is appearing with empty data. Below is my code. you can see in the value field I am trying to add "[{$fDifference}]" variable but it not working

[{if $freeDeliveryTotalPrice && $freeDeliveryTotalPrice > $totalPrice}]
    [{assign var="difference" value=$freeDeliveryTotalPrice-$totalPrice}]

[{php}]
    $difference = $this->get_template_vars('difference');
    $this->assign('fDifference',\OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($difference));
[{/php}]


<div class="free-delivery-notice">
    <meter id="meter" value="[{$fDifference}]" min="0" max="49"></meter><br>
    <span class="price">[{$fDifference}] [{$currency->sign}]</span> [{oxmultilang ident="JXPYSIOXPRESSTHEME_CHECKOUT_FREE_DELIVERY_NOTICE"}]
</div>

[{/if}]

output:

Output