jQuery Plugin For Currency Formatting and Converting - Currency
File Size: | 11.8 KB |
---|---|
Views Total: | 4279 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |
A simple jQuery plugin allows to formats numbers with currency symbols as well as performing foreign exchange conversions using Google Finance's Currency Converter API.
How to use it:
1. Load the jquery.currency.js
after jQuery library.
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="jquery.currency.js"></script>
2. Upload the convert.php
to your web server.
3. Basic usage.
<span id="basic">123456.789</span> <script> $("#basic").currency(); </script>
4. This will convert 123456.789
into $123,456.79
.
5. All the options.
$("#basic").currency({ // The 3 digit ISO code you want to display your currency in region: "USD", // Thousands separator thousands: ",", // Decimal separator decimal: ".", // How many decimals to show decimals: 2, // Hide any prefix hidePrefix: false, // Hide any postfix hidePostfix: false, // If converting, the 3 digit ISO code you want to convert from, convertFrom: "", // Loading message appended to values while converting convertLoading: "(Converting...)", // Location of convert.php file convertLocation: "convert.php" });
This awesome jQuery plugin is developed by CodersPress. For more Advanced Usages, please check the demo page or visit the official website.