joomla - Format (to currency) php syntax in K2 STORE -


i customizing k2 store front end , need currency formatting.

my code is:

<span>tax: <?php echo $item->tax ?></span> <span>price without tax: <?php echo $item->price; ?></span> 

don't know why code outputs:

tax: 11 price without tax: 50.00000 

i output:

tax: 11,00 eur price without tax: 50,00 eur 

i found hints formatting values in php not able implement in case. have poor php knowledge.

how using php's money_format function? in case similar so post seems have answer

setlocale(lc_monetary, 'nl_nl.utf-8'); $amount = money_format('%(#1n', $amount); echo $amount; 

you put function like

function to_euro($input){     setlocale(lc_monetary, 'nl_nl.utf-8');     return money_format('%(#1n', $input); } 

then use like

echo to_euro($item->tax); 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -