wordpress - woocommerce - custom price formatting -



wordpress - woocommerce - custom price formatting -

i'm using woocommerce build custom theme webshop. cost formatting i'm getting is: '150' when cost 150. want achieve:

price = '150,00' when cost filled in '150' price = '150,50' when cost filled in '150,50' price = '150,55' when cost filled in '150,55'

so want add together ',' , 2 decimals in 'sup' tags. seems pretty straightforward, can't done. anyway here can help me?

you can utilize php function - number_format() decimal points convert in ,

$n = number_format($number, 2, ',', ' ');

for superscript, seek below

try this:-

$parts = explode(',', $price); echo "$parts[0],<sup>$parts[1]</sup>";

wordpress wordpress-plugin wordpress-theming woocommerce

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -