WPCS - WordPress Currency Switcher

$WPCS->back_converts()

Useful function when you want to convert any amount in non-basic currency into basic currency amount. For example you have 40GBP. Basic currency of your shop is EUR, to convert that 40GBP into XX EUR you are need do next:

global $WPCS;
$res=$WPCS->back_convert(40,0.8343,2);
  • 40 – amount in GBP
  • 0.8343 – rate of 1 GBP relatively to 1 EUR. Currency rate can be get by the next function: $WPCS->get_currencies()
  • 2 – decimals in the result value $res

func-79-1