Version 1.0.1

Currencyr for jQuery


A simple yet advance currency converter

UI plugin for jQuery. Instead of traditional "calculator" looks converter, Currencyr came with "tooltip" looks idea right near the amount selector.

Le click $ — Milk: $2.35, Catfood: $15, Beers: $7.57

Dependencies

Installation

Include these lines after jQuery library.

<style rel="stylesheet" type="text/css" href="/path/to/currencyr.css">
<style rel="stylesheet" type="text/css" href="/path/to/themes/@theme@/@theme@.css">
<script src="/path/to/currencyr.js"></script>

Usage

First you MUST assign the currencies, base and rates:

var currencies = {
        "AED": "United Arab Emirates Dirham",
        "AFN": "Afghan Afghani",
        "ALL": "Albanian Lek",
        "AMD": "Armenian Dram",
        ...
    },
    base = 'USD',
    rates = {
        "AED": 3.673177,
        "AFN": 51.719367,
        "ALL": 107.942001,
        "AMD": 405.503334,
        ...
    };

$.currencyr( currencies, base, rates );

It doesn't matter the way it assigned, statically or dinamically flavour.

Then call the plugin right on selector:

$('.amount').currencyr();

It's super easy to integrate with Open Exchange Rates:

var appId = YOUR_APP_ID;
$.getJSON( 'http://openexchangerates.org/api/currencies.json', function( response ) {
    var currencies = response;
    $.getJSON( 'http://openexchangerates.org/api/latest.json', { 'app_id': appId }, function( response ) {
        $.currencyr( currencies, response.base, response.rates );
        $( '.amount' ).currencyr();
    });
});

Options

$('.amount').currencyr( { option_name: option_value } );

Roadmap

Feedback

If you have any feedback, any at all, tweet @firmanw, or head over to the Currencyr github repository and create a new issue.