Currency conversion and money formating libraries in Javascript

money.js

These are 2 very useful Javascript libraries for dealing with money currency and formatting written by Joss Crowcroft.

Currency conversion with money.js

money.js is a currency conversion library with no dependencies, in just over 1 KB. You could provide your own currency rates in JSON format or use the data from the Open Source Exchange Rates project which is also created by Joss Crowcroft and looks very promising!

Usage examples:

// From any currency, to any currency:
fx.convert(12.99, {from: "GBP", to: "HKD"});

// Chaining:
fx(1000).from("USD").to("GBP");
fx(1000).to("AED");

// With simple settings and defaults, making this possible:
fx.convert(5318008);
fx(5318008).to("AED");

Money formatting with accounting.js

accounting.js is a small library for number, money and currency formatting, with optional excel-style column rendering (to line up symbols and decimals). It's lightweight, fully localisable and has no dependencies.

I've been using accounting.js for a month -in the administration panel of an e-commerce system- and had zero problems so far.

Usage examples:

// Default usage:
accounting.formatMoney(12345678); // $12,345,678.00

// European formatting (custom symbol and separators), could also use options object as second param:
accounting.formatMoney(4999.99, "€", 2, ".", ","); // €4.999,99

// Negative values are formatted nicely, too:
accounting.formatMoney(-500000, "£ ", 0); // £ -500,000

// Simple `format` string allows control of symbol position [%v = value, %s = symbol]:
accounting.formatMoney(5318008, { symbol: "GBP",  format: "%v %s" }); // 5,318,008.00 GBP

// Formatting numbers
accounting.formatNumber(5318008); // 5,318,008
accounting.formatNumber(9876543.21, 3, " "); // 9 876 543.210

// Unformatting numbers / currency strings
accounting.unformat("£ 12,345,678.90 GBP"); // 12345678.9

Comments

Jason  •  March 6, 2013 03:49

accounting.formatMoney(4999.99, "€", 2, ".", ","); // €4.999,99 -> this is useless.

Fredy  •  October 4, 2013 12:07

@Jason
I think you do not see the big picture

if you replace the 4999.99 by a variable then this function is very useful

Ermir  •  April 28, 2014 13:42

Hey thanks for this great information :) Was a pleasure reading it :)

obat perangsang wanita  •  June 24, 2014 12:00

wanita sedikit bingung disaat hubungan seksualnya sudah berkurang maka dari itu mereka takut jika pasangannya berpaling darinya oleh karena itu ini saat yang tepat dan cepat membangkitkan libido dengan obat perangsang wanita herbal alami dan sangat aman.

sara  •  November 3, 2014 08:13

Forex trading is open 24 hours a day and therefore you need to ensure that the forex broker that you choose operates at all times of the day. 

Forex Trading Platform

ace maxs  •  December 10, 2014 09:56

thanks for sharing mr

Portal Medan  •  December 26, 2014 17:00

This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post.
http://www.caramakan.com | http://wahyublahe.com | http://merdekawalk.com | http://www.ceritamedan.com | http://www.22jerseybola.com | http://ceritamedan.blogdetik.com | http://inimedan.com | http://nasutionrizky.com | http://tamvanseo.blogspot.com | http://medanheritage.com | http://wahyublahe.blogspot.com | http://www.ceritamedan.com/2014/09/Pancake-Durian.html

http://goo.gl/SvFXl4 Social Media Buzzer | http://goo.gl/OgqOHo Cara Membuat Paspor Online | http://goo.gl/KGDkqN Manfaat Mandi Pagi | http://goo.gl/qYsBRi Cara Cek Nomor HP | http://goo.gl/l7uCgL Jasa SEO Medan | http://goo.gl/kFlME0 Cara Pakai Tongsis | http://goo.gl/O43aib Gaya Pacaran Anak Muda | http://goo.gl/1s6xwm Desain Kamar Tidur Anak Perempuan |

http://goo.gl/pAO4gM Cara Menurunkan Berat Badan | http://goo.gl/sfA5RT Foto Selfie | http://goo.gl/YVD20z Cara Menulis Cerita Fiksi | http://goo.gl/IMYXbC Manfaat Air Putih | http://goo.gl/kVbVxJ Parfum Pria | http://goo.gl/KGMUVR Kunci Jawaban Tebak Gambar | http://goo.gl/Dyh1zw Wisata Medan | http://goo.gl/wsViV0 Transportasi Medan | http://goo.gl/HuKSTI Pelaruga | http://goo.gl/uNLn51 Kuliner Medan | http://goo.gl/OKb0IJ Komunitas Medan | http://goo.gl/k1vK9X Berita Komunitas | http://goo.gl/98iCdo Oleh Oleh Khas Medan |
http://goo.gl/kWYmnK | http://goo.gl/ATnmhV Toko Roti di Medan | http://goo.gl/51UapI Cara Menjadi Barista | http://goo.gl/nurVHd Cara Menjadi Kaya | http://goo.gl/3LeXRA Cara Menjadi Model | http://goo.gl/4FQYi9 Cara Menjadi Ibu yang Baik | http://goo.gl/EqsY7i Tips Menjadi Penulis Hebat | http://goo.gl/3nJnZl Kopi Medan | http://goo.gl/4VQsNE Pulau Siba | http://goo.gl/Ey8A2h Daftar Film Bioskop Terbaru 2015 | http://goo.gl/MYEkbd Gaya Foto Prewedding

agen tiket pesawat  •  January 12, 2015 07:15

many thanks for share this

bisnis tiket pesawat  •  January 12, 2015 07:15

makasih atas info yang sangat menarik ini

usaha tiket pesawat  •  January 12, 2015 07:15

wow excellent content

dongdong32  •  January 23, 2015 16:41

http://lululemon.suleymanaltun.com
http://toms.raleighdowntowner.co
http://www.marc--jacobs.com
http://concord11.sellittodaywithebay.com
http://raybanwayfarer.thedailysabs.com
http://www.ralph-laurenoutlet.com.co
http://www.canadagoosejackets.name
http://www.lebronjames-shoes.net
http://www.louisvuittonhandbags.net.co
http://oakleysunglassescheap.oakleywebsite.net
http://christianlouboutinoutlet.maximumguarantee.com
http://www.jordan11.name
http://raybansunglasses.thedailysabs.com
http://www.lebronjames-shoes.name
http://www.fitflop-shoes.us
http://www.louis--vuitton.us
http://www.insanityworkout.com.co
http://truereligion.onlineinc.net.co
http://www.ugg-boots.eu.com
http://www.supra-shoes.cc
http://www.michaelkorshandbags.eu.com
http://knockoffwatches.freebirdspublishing.com
http://raybans.thedailysabs.com
http://www.ugg-boots.com.co
http://canadagoosejackets.pensacolacandles.com
http://www.toryburch-outletonline.com.co
http://www.ugg-boots.in.net
http://christianlouboutin.maximumguarantee.com
http://www.prada-outlet.us
http://oakleysunglasses.oakleywebsite.net
http://www.timberlandboots.cc
http://www.retrojordans.name
http://www.abercrombiekids.name
http://www.tory-burchoutlet.in.net
http://www.cheap-jordans.us.com
http://www.christian-louboutinoutlet.com.co
http://www.coach-outlet.us.com
http://www.celine-outlet.us
http://burberryoutlet.newestsite.net
http://www.hollisterkids.net
http://todsoutletstore.kingmancommercialrealestate.com
http://www.abercrombieandfitch.net.co
http://cheapoakleys.oakleywebsite.net
http://rayban.letterpresskids.com
http://www.polo-ralphlauren.net.co
http://www.louisvuitton-lvoutlet.com
http://tomswedges.raleighdowntowner.co
http://www.oakleysunglassescheap.name
http://www.truereligion.eu.com
http://www.louisvuittonoutlet.net.co

www.scorespro.com  •  January 28, 2015 06:17

All of us present the overall divisibility rule for any Divisor the industry prime quantity and put it on to particular cases. The reason is articulate and simple to follow, realize and utilize. www.scorespro.com

cara mengobati ambeien  •  February 14, 2015 03:02

Agan, how in order to be accepted in adsanse

ask for help :)

22x  •  February 28, 2015 09:38

11a 11s 11d 11f 11g 11h 11j 11k 11l 11z

22x 22c 22v 22b 22n 22m 22p 22o 22u 22y 22e

33h 33j 33k 33g 33f 33d 33s 33a 33t 33w 33q

cheap,jordans 4 black cat  •  March 7, 2015 02:58


[url=http://www.airjordan4.uk.com/]air jordan,air jordan 4,air jordan uk,air jordan 4 retro,air jordan cheap,jordans 4 black cat[/url]
[url=http://www.airjordan4.uk.com/air-jordan-3-retro-c-9.html]air jordan 3 uk,air jordan sale,air jordan 3 retro,men's air jordan 3[/url]
[url=http://www.airjordan4.uk.com/air-jordan-6-retro-c-3.html]air jordan 6 uk,air jordan 6 womens,air jordan 6 mens,air jordan 6 retro[/url]
[url=http://www.airjordan4.uk.com/nike-air-yeezy-2-c-7.html]cheap nike air yeezy 2,air yeezy 2 sale,air yeezy 2 uk,air yeezy 2 mens[/url]
[url=http://www.airjordan11.uk.com/]air jordan 11,air jordan 11 uk,air jordan 11 cheap,air jordan 11 low,air jordan 11 sale[/url]
[url=http://www.airjordan11.uk.com/air-jordan-5-retro-c-19.html]air jordan 5 retro uk,cheap air jordan 5,air jordan 5 sale[/url]
[url=http://www.nikefreerun.me.uk/]nike free run,nike free run sale,cheap nike free run,womens nike free run[/url]
[url=http://www.nikefreerun.me.uk/nike-dunk-sky-high-womens-c-5.html]nike dunk sky high uk,nike dunk sky high womens,nike dunk sky high,nike dunk sky high wedge[/url]
[url=http://www.nikefreerun.me.uk/nike-revolution-sky-hi-womens-c-15.html]nike revolution sky hi,nike revolution sky hi wedge,nike revolution sky hi uk,nike revolution sky hi city pack[/url]
[url=http://www.newbalance996.co.uk/]new balance,cheap new balance,new balance 996,new balance 996 women,new balance 996 sale,new balance uk[/url]
[url=http://www.newbalance996.co.uk/asics-mens-c-4.html]asics gel kinsei 4,asics gel kinsei 5,asics gel kinsei 5 womens,asics gel kinsei 5 mens,asics gel sale[/url]

cara pemesanan ace maxs  •  March 9, 2015 10:43

thank your share :)

girlsdoporn  •  March 14, 2015 13:46

What a good blog you have here. Please update it more often. This topics is my interest. Thank you. . .

buy facebook likes  •  March 19, 2015 07:53

Thanks very much for this great article;this is the stuff that keeps me going through out these day.

buying facebook likes  •  March 19, 2015 07:54

Should there be another persuasive post you can share next time, I’ll be surely waiting for it.

http://www.aspiremotoring.com/  •  March 19, 2015 13:53

Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign!

buy cheap facebook page likes  •  March 19, 2015 15:23

Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing...
buy cheap facebook page likes

mattress reviews 2014  •  March 20, 2015 08:43

Yes, great US Military force. Also, in his post you have given a chance to listen about US Military. I really appreciate your work. Thanks for sharing it.

best mattress for side sleepers  •  March 20, 2015 09:20

I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.

SEO  •  March 21, 2015 16:27

I also benefit from learning the assessments, but learn that alot of people ought to stay on essay to try and add worth in the direction of the authentic weblog release.

jual topi online  •  March 23, 2015 09:51

nice sharing dude , i love you

jual sepatu online  •  March 23, 2015 09:52

nice sharing brotha thanks for it

sweater pria  •  March 23, 2015 09:52

great sharing and thanks

jual tas laptop  •  March 23, 2015 09:53

thanks for sharing this brotha i just can say it

tas ransel pria terbaru  •  March 23, 2015 09:55

a great website with the good articel

jual ikat pinggang kulit  •  March 23, 2015 09:55

wow awesome articel you has made

jual kemeja pria  •  March 23, 2015 09:55

this is great articel , i like it

celana jeans pria  •  March 23, 2015 09:56

this is great articel to read

jual celana pantai murah  •  March 23, 2015 09:56

thanks for this share

jam tangan pria  •  March 23, 2015 09:57

All of us present the overall divisibility rule for any Divisor the industry prime quantity and put it on to particular cases. The reason is articulate and simple to follow, realize and utilize

usaha tiket pesawat  •  March 23, 2015 09:57

awesome , this is very awesome post

bisnis tiket pesawat  •  March 23, 2015 09:58

i really appreciate this articel thanks

agen tiket pesawat  •  March 23, 2015 09:58

thanks for informative share i was inspiring

jasa seo  •  March 23, 2015 09:59

thanks i read yur blog while at home i do my homework

jasa seo profesional  •  March 23, 2015 09:59

Should there be another persuasive post you can share next time, I’ll be surely waiting for it.

pakar seo  •  March 23, 2015 10:00

thanks alot

jual tas laptop  •  March 23, 2015 10:00

this is awesome post i ever read

dress wanita terbaru  •  March 23, 2015 10:01

great sharing backlash i really like your site

tas wanita terbaru  •  March 23, 2015 10:01

thanks for share this , i appreciate this

isabisformulae.com  •  March 24, 2015 10:25

Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing...

CT Personal Injury Attorney  •  March 24, 2015 15:31

You have raised an important issue..Thanks for sharing..I would like to read more current affairs from this blog..keep posting..

purchase facebook likes cheap  •  March 26, 2015 14:29

Should there be another persuasive post you can share next time, I’ll be surely waiting for it.

Victorino Noval  •  March 28, 2015 15:24

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work.

Clash of Clans Astuce  •  March 31, 2015 09:15

I came onto your blog while focusing just slightly submits. Nice strategy for next, I will be bookmarking at once seize your complete rises
Clash of Clans Astuce

private air charter  •  April 1, 2015 11:32

Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging,

memory foam buying guide  •  April 4, 2015 12:38

wow this good but ,I like your post and good pics may be any peoples not like because defrent mind all poeple ,

highpr dofollow blog comment  •  April 5, 2015 11:19

wow this good but ,I like your post and good pics may be any peoples not like because defrent mind all poeple ,

Obat Darah Tinggi  •  April 6, 2015 05:26

beautiful this morning discordant notes scram you , let us.

mattress platform  •  April 6, 2015 12:48

wow this good but ,I like your post and good pics may be any peoples not like because defrent mind all poeple ,

obat kanker payudara  •  April 7, 2015 04:59



mantap artikelnya.. sharing ilmu :D

credit restoration  •  April 11, 2015 11:31

What a blog post!! Very informative and also easy to understand. Looking for more such comments!! Do you have a facebook? I recommended it on digg. The only thing that it’s missing is a bit of new design.

matcha  •  April 13, 2015 01:48

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job!

girlsdoporn  •  April 13, 2015 09:51

Great, This specific net webpage is seriously thrilling and enjoyment to learn. I’m an enormous fan from the subjects mentioned.

prints  •  April 14, 2015 00:18

The internet is bogged down with bogus blogs with no real message but the post was fantastic and well worth the read.Thank you for sharing this with me.

girlsdoporn  •  April 14, 2015 09:20

The first several months of my site there were no comments; just give it time; now they come in like crazy every day! Thanks.

ab workout review  •  April 14, 2015 13:22

Thanks for providing recent updates regarding the concern, I look forward to read more

my blog  •  April 14, 2015 13:35

I also benefit from learning the assessments, but learn that alot of people ought to stay on essay to try and add worth in the direction of the authentic weblog release.

girlsdoporn  •  April 14, 2015 16:36

This is a great article, Thanks for giving me this information. Keep posting.

Agen Green World di Kotabaru  •  April 15, 2015 11:50

Thanks for sharing gan..........

Gagal Ginjal Dapat Disebabkan Es Teh  •  April 16, 2015 07:28

The information is very interesting

best mattress for back and hip pain  •  April 16, 2015 13:02

The first several months of my site there were no comments; just give it time; now they come in like crazy every day! Thanks.

best king size mattress  •  April 16, 2015 14:24

Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me.

girlsdoporn  •  April 18, 2015 13:07

Should there be another persuasive post you can share next time, I’ll be surely waiting for it.

girlsdoporn  •  April 20, 2015 14:47

You have raised an important issue..Thanks for sharing..I would like to read more current affairs from this blog..keep posting..

Christian links  •  April 21, 2015 10:01

Thank you for posting such a great article! I found your website perfect for my needs. It contains wonderful and helpful posts. Keep up the good work!

penyakit ginjal  •  April 22, 2015 10:08

Wooow amazing

buy youtube views mobile  •  April 22, 2015 15:06

Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing...

rohana wheels  •  April 24, 2015 15:25

Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing...

packers and movers  •  April 25, 2015 13:43

Here are some helpful things for you

Packers and Movers Faridabad @ http://3th.co.in/packers-and-movers-faridabad/
Packers and Movers Ghaziabad @ http://3th.co.in/packers-and-movers-ghaziabad/
Packers and Movers Noida @ http://3th.co.in/packers-and-movers-noida/
Packers and Movers Delhi @ http://3th.co.in/packers-and-movers-delhi/

mastoplastica Additiva Milano  •  April 25, 2015 15:41

You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site.

sam  •  April 27, 2015 18:24

nice post articles about technology

techiestate  •  April 27, 2015 19:04

nice information

tips4finance  •  April 27, 2015 19:20

nice information

CX3315  •  April 29, 2015 09:57

your articel is good
Crystal X Mengatasi Keputihan
http://www.crystalxmengatasikeputihan.com
Keunggulan Produk Herbal Crystal X
http://www.crystalxmengatasikeputihan.com/2015/04/keunggulan-dari-crystal-x.html
Kandungan Terdapat Pada Crystal X
http://www.crystalxmengatasikeputihan.com/2015/04/kandungan-obat-herbal-crystalx.html
CRYSTAL X UNTUK PROGRAM HAMIL
http://www.crystalxmengatasikeputihan.com/2015/04/crystal-x-untuk-program-hamil-istri.html
Produk Terapi Untuk Suami Agar Istri Cepat Hamil
http://www.crystalxmengatasikeputihan.com/2015/04/produk-terapi-untuk-suami-agar-istri-cepat-hamil.html
Cara Pemesanan Produk Crytal X
http://www.crystalxmengatasikeputihan.com/p/blog-page.html
Cara Pemakaian Crystal X untuk Hasil Memuaskan
http://www.crystalxmengatasikeputihan.com/2015/04/cara-pemakaian-crystal-x-untuk-hasil.html
Crystal X Benar-Benar Aman
http://www.crystalxmengatasikeputihan.com/2015/04/apakah-crystal-x-benar-benar-aman_22.html
Khasiat Crystal X Merawat Organ Intim
http://www.crystalxmengatasikeputihan.com/2015/04/khasiat-crystal-x-merawat-organ-intim.html
Mengatasi Keputihan Dengan Crystal X
http://www.crystalxmengatasikeputihan.com/2015/04/mengatasi-keputihan-dengan-crystal-x.html
Peranan Crystal X Sebagai Pembunuh Bakteri Jahat
http://www.crystalxmengatasikeputihan.com/2015/04/peranan-crystal-x-sebagai-pembunuh.html
Fungsi Crystal X Untuk Memperlancar Menstruasi
http://www.crystalxmengatasikeputihan.com/2015/04/fungsi-crystal-x-untuk-memperlancar.html
Efek Samping Penggunaan Crystal X
http://www.crystalxmengatasikeputihan.com/2015/04/efek-samping-penggunaan-crystal-x.html
Mengatasi Keputihan Dengan Crystal X
http://www.crystalxmengatasikeputihan.com/2015/04/mengatasi-keputihan-dengan-crystal-x.html

clash of clans astuce pour  •  April 29, 2015 10:40

You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site.

free classified ads no registration needed  •  April 30, 2015 11:16

My friend mentioned to me your blog, so I thought I’d read it for myself. Very interesting insights, will be back for more!

astuce clash of clan  •  May 4, 2015 09:53

You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site.

Obat Ginjal  •  May 5, 2015 05:06

Great, This specific net webpage is seriously thrilling and enjoyment to learn. I’m an enormous fan from the subjects mentioned.

best minecraft servers  •  May 7, 2015 05:07

With the changing of currency at this time, I think using this part will not too effective. We will keep editing the amount for everyday. But the good thing is, we can set the whole site from one page only.

nancy john  •  May 8, 2015 07:36

It will be improve the trading skills which will be beneficial for traders

Forex Trading software

sara  •  May 8, 2015 07:37

The forex market is the largest, most liquid market in the world with an average traded value that exceeds $1.9 trillion per day and includes all of the currencies in the world. 

trading mistakes

Penyakit Ginjal Akut Dan Kronis  •  May 8, 2015 08:40

“Pahit dan manis bercampur adalah suatu kenikmatan, seperti kopi yang disajikan ketika hangat ataupun dingin. Tambahkan gula jika terlalu pahit atau hangatkan jika terlalu dingin;
Seperti itulah hidup, kita sendiri yang menentukan tingkat kenikmatannya dengan tetap bersyukur atas nikmat yang diberikan Allah”

Obat Pelancar Haid  •  May 9, 2015 09:56

Thank you for the information
Obat Pelancar Haid

Bodyweight Burn  •  May 9, 2015 16:12

I've been using accounting.js for a month -in the administration panel of an e-commerce system- and had zero problems so far.

instagram followers jailbreak 2015  •  May 12, 2015 15:12

My friend mentioned to me your blog, so I thought I’d read it for myself. Very interesting insights, will be back for more!

Jasa Iklan Facebook  •  May 17, 2015 07:47

This wonderful post for you. I assure this would be beneficial for most of the people.

Motley Models  •  May 20, 2015 13:13

Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here. Motley Models

rims and tires for sale  •  May 22, 2015 07:59

Yes, great US Military force. Also, in his post you have given a chance to listen about US Military. I really appreciate your work. Thanks for sharing it.

revertir la diabetes descargar gratis  •  May 23, 2015 17:18

World wide web growth, Shelley Lowery along with web-source. world wide web.

seduccion elite pdf  •  May 25, 2015 14:39

it is published both for beginners and for those that are trying hard to acquire their multiple stage multilevel promotion companies off the floor. Click to find more about My Cause Program Pro.

seo social media traffic  •  May 25, 2015 15:58

Hello there! This is my first comment here so I just wanted to give a quick shout out and say I genuinely enjoy reading your articles. Can you recommend any other blogs/websites/forums that deal with the same subjects?

http://mattressfirmmemorialdaysale.snappages.com/  •  May 26, 2015 14:26

Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me.

trading and forex systems  •  May 26, 2015 15:37

Thanks for sharing the info, keep up the good work going.... I really enjoyed exploring your site. good resource...

Post your comment

(optional)
(optional, will not be shown)
NOTE: Any links will have rel="nofollow"

back