Categories

  • Access & Security 95
  • Administration 172
  • Advertisement 92
  • Audio & Video 66
  • Author & Content 99
  • Comments 96
  • Communication 110
  • Communities & Forums 84
  • Development 47
  • E-Commerce 76
  • Email Management 53
  • Events & Calendars 80
  • Language 25
  • Map & Weather 44
  • Migration & Conversion 28
  • Miscellaneous 254
  • Mobile 15
  • Photos 143
  • Plugins 260
  • SEO & Site Speed 118
  • Social 186
  • Theme Enhancement 169



  • Add this plugin to a List

    You need to be logged in to add this plugin to your list.

    Euro FxRef Currency Converter

    Add to List

    Using the [currency] shortcode you can convert one currency to another. The conversion is based on the rates published by the ECB (updated daily between 2.15 p.m. and 3.00 p.m. CET).

    You can change from and to any of the supported currencies.

    The [currency_legal] shortcode outputs a disclaimer text and a link to the ECB eurofxref page.

    This plugin is based on a plugin by Xclamation.

    Also see https://github.com/joostdekeijzer/wp_eurofxref

    Shortcode usage & examples

    currency_legal shortcode

    This shortcode returns the string ‘* For informational purposes only. Exchange rates may vary. Based on ECB reference rates.’

    The prepended ‘* ‘ (the same string as the [currency] append string) can be changed using the ‘prepend’ attribute.

    For example: [currency_legal prepend='Please note: ']

    legal_string method

    The legal string can also be retrieved in PHP

    Usage

    <?php echo EuroFxRef::legal_string( $prepend ) ?>
    

    Parameters

    • $prepend (string) The string to prepend the legal text with, default ‘* ‘

    Return Value

    (string) Legal text prepended with $prepend string.

    currency shortcode

    • from: currency code (default: EUR)
    • to: currency code (default: USD)
    • amount: number of “from” currency (default: 1)
    • iso: boolean (true or false, default false); use ISO currency
      formatting
    • show_from: boolean (default true); show from amount in output
    • between: string (default ‘&nbsp;/&nbsp;’ which is displayed as
      ‘ / ‘ in the browser); string between from and to amounts
    • append: string (default ‘&nbsp;‘ which is displayed as ‘ ‘ in
      the browser); string put after conversion. The * references the
      disclaimer text, see [currency_legal] shortcode.
    • round: boolean (default true); Round numbers to whole units.
    • round_append: string (default ‘=’); replaces decimals
    • to_style: css formatting text (default
      ‘cursor:help;border-bottom:1px dotted gray;’); styling of “to”
      text.

    Conversion from non-Euro to non-Euro is done through the Euro, so GBP to USD is calculated as GBP -> EUR -> USD.

    convert method

    Since v1.3, you can call the convertor staticly from PHP in your code.

    Usage

    <?php EuroFxRef::convert( $amount, $from, $to ); ?>
    

    Parameters

    • $amount (float) The amount of currency you want to convert.
    • $from (string) The currency code the amount is in, default EUR.
    • $to (string) The currency code the amount must be converted to, default USD

    Return Value

    (float) the converted value or 0 (zero) if any of the currency code’s are not available.

    Examples

    • [currency amount="875" from="EUR" to="GBP"]
      becomes “€ 875,= / £ 697.= *”
    • [currency amount="875" from="GBP" to="USD" iso=true between=" converts to " append="" round_append=""]
      becomes “875 GBP converts to 1,418 USD”
    • [currency amount="875" from="GBP" to="USD" show_from=false round=false]
      becomes “$ 1,130.15 *”

    • <?php $process_later = EuroFxRef::convert( 10, 'USD', 'GBP' ); ?>
      will return the raw numeric (float) value without formatting: 6.01877256317689468545495401485823094844818115234375

    Currently available currencies

    • EUR Euro (€)
    • USD US Dollar ($)
    • JPY Japanese Yen (¥)
    • BGN Bulgarian Lev (ЛВ.)
    • CZK Czech Republic Koruna (Kč)
    • DKK Danish Krone (kr)
    • GBP British Pound Sterling (£)
    • HUF Hungarian Forint (Ft)
    • LTL Lithuanian Litas (Lt)
    • LVL Latvian Lats (Ls)
    • PLN Polish Zloty (zł)
    • RON New Romanian Leu (RON)
    • SEK Swedish Krona (kr)
    • CHF Swiss Franc (CHF)
    • NOK Norwegian Krone (kr)
    • HRK Croatian Kuna (kn)
    • RUB Russian Rouble (py6.)
    • TRY Turkish Lira (TL)
    • AUD Australian Dollar ($)
    • BRL Brasilian Real (R$)
    • CAD Canadian Dollar ($)
    • CNY Chinese Yuan (元)
    • HKD Hong Kong Dollar ($)
    • IDR Indonesian Rupiah (Rp)
    • ILS Israeli New Sheqel (₪)
    • INR Indian Rupee (₹)
    • KRW South Korean Won (₩)
    • MXN Mexican Peso ($)
    • MYR Malaysian Ringgit (RM)
    • NZD New Zealand Dollar ($)
    • PHP Philippine Peso (₱)
    • SGD Singapore Dollar ($)
    • THB Thai Baht (฿)
    • ZAR South African Rand (R)
    Rate This Plugin

    Please Login to Rate this Plugin!

    Function

    Feature

    Support

    0 Votes
    Not Rated Yet

    Wordpress.org Stats

    Ratings5
    Votes4
    Downloads5,053
    Last Updated126 Days ago
    Published5 years ago

    Report Wrong Category!