Custom Price Formatter

May 27th, 2014
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function my_em_formatter($formatted_price, $price, $currency, $format){
  2. $formatted_price = '';
  3. if(!$format) $format = get_option('dbem_bookings_currency_format','@#');
  4. if(!$currency) $currency = get_option('dbem_bookings_currency');
  5. $formatted_price = str_replace('@', em_get_currency_symbol(true,$currency), $format);
  6. $formatted_price = str_replace('#', number_format( $price, 4, get_option('dbem_bookings_currency_decimal_point','.'), get_option('dbem_bookings_currency_thousands_sep',',') ), $formatted_price);
  7. return $formatted_price;
  8. }
  9. add_filter('em_get_currency_formatted','my_em_formatter',100,4);
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add to your ad blocker whitelist or disable your adblocking software.