<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Adam Penly on Medium]]></title>
        <description><![CDATA[Stories by Adam Penly on Medium]]></description>
        <link>https://medium.com/@adampenly?source=rss-8922f47e514e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wRELRPO8PdX5MrwJ63vZ6w.jpeg</url>
            <title>Stories by Adam Penly on Medium</title>
            <link>https://medium.com/@adampenly?source=rss-8922f47e514e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 04:55:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adampenly/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I wrote a dead simple jQuery currency converter]]></title>
            <link>https://medium.com/@adampenly/i-wrote-a-dead-simple-jquery-currency-converter-dbb8919ce7e7?source=rss-8922f47e514e------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbb8919ce7e7</guid>
            <category><![CDATA[jquery]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[currency]]></category>
            <category><![CDATA[utilities]]></category>
            <dc:creator><![CDATA[Adam Penly]]></dc:creator>
            <pubDate>Mon, 17 Apr 2017 14:51:22 GMT</pubDate>
            <atom:updated>2017-04-17T14:51:22.841Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WB7AeA9tAiuBOKNyHgBOQA.png" /></figure><p>While browsing on a UK clothing site one night, I kept bouncing back and forth between the site and Google to check prices in US dollars. It wasn’t terribly annoying, but I thought it might be nice to write something that would let developers include price conversions in their websites on the fly. I call it <strong>Current</strong>, and you can find it on Github here: <a href="https://github.com/frmlnd/frmlnd-current">https://github.com/frmlnd/frmlnd-current</a></p><p>I decided to go with jQuery for this plugin for a couple reasons. The first is just that I hadn’t worked with jQuery for a while and wanted to revisit it for old times’ sake (and later on, to check out version 3.x — The demo site is using 3.2.1 at the moment). The second reason is that jQuery makes it really easy to create DOM-manipulating plugins without a ton of overhead. React would be smaller, and vanilla JavaScript would be smaller still, so maybe I’ll post an update at some point with some performance enhancements.</p><p><strong>Current</strong> takes a currency amount — say US Dollars — and converts it to your choice of outputs. By simply including a couple attributes in your HTML code, you’ll get currency conversions on hover, click, or inline.</p><p>For example, the following code will use the U.S. Dollar as a base and return Euros, Japanese Yen, and Chinese Yuan to the UI as a hover element:</p><pre>&lt;span class=&quot;crrnt-currency&quot; data-crrnt-base=&quot;USD&quot; data-crrnt-currencies=&quot;EUR,JPY,CNY&quot;&gt;$100.63&lt;/span&gt;</pre><p>Pretty easy, right? Here’s a simpler example, which uses the plugin’s default settings:</p><pre>&lt;span class=&quot;crrnt-currency&quot;&gt;$100.63&lt;/span&gt;</pre><p>Both of the above will produce something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhTy2HTPtXQrjEBRXR4qYg.png" /></figure><p>Can’t get much easier than that. As mentioned before, you can choose to show conversions when you hover over an element that carries the <strong>crrnt-currency </strong>class property, or you can show conversions on click by coupling <strong>click </strong>with the above class attribute, or finally inline by including the <strong>inline</strong> class in your<strong> crrnt-currency</strong> element.</p><p>This plugin leverages jQuery as well as the <a href="https://openexchangerates.org/">Open Exchange Rates API</a> to create an ultra-lightweight, simple currency conversion display tool that’s easy to use with your web application. The Open Exchange Rates API requires an API key, which you’ll need to procure <a href="https://openexchangerates.org/signup">here</a>.</p><p>I hope you find some use for this plugin, and please let me know if you do. It would be great to see it used in shopping carts and contextual commerce applications, or wherever you find it’s useful!</p><p><strong>Github repo with installation and usage instructions: </strong><a href="https://github.com/frmlnd/frmlnd-current">https://github.com/frmlnd/frmlnd-current</a></p><p><strong>Demo page:</strong> <a href="http://frmlnd.github.io/frmlnd-current/">http://frmlnd.github.io/frmlnd-current/</a></p><p><strong>Enjoy!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbb8919ce7e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>