osrec / currencyFormatter.js

A super simple currency formatting library
MIT License
635 stars 61 forks source link

Is it possible to extend this to cover crypto? #35

Open b0y2k opened 5 years ago

b0y2k commented 5 years ago

Hi, i have a framework which covers Fiat and Crypto balances. Would it be possible to have a parameter which allowed you do edit the precision of the decimal? Some cryptos have 8 decimals and some 3, being able to show this and also remove the currency symbol would allow use across the board.

osrec commented 5 years ago

Yes of course. We'll get this included in the next release.

b0y2k commented 5 years ago

That would be amazing :) currently working on crypto implementations for our games so this would be a great help.

osrec commented 5 years ago

@b0y2k do you happen to have a list of currencies and default formats?

b0y2k commented 5 years ago

I'm trying to find out if there is somewhere that lists all the formats. There are not many variants to be fair (most are forks of BTC) BTC/ETH/LTC etc - eight decimal places Steem/EOS/BTS - 3 decimal places Nano / Iota no decimal places but the option of adding one for display. 7,980,184 nano would be (7.980184 NANO) for example

b0y2k commented 4 years ago

Hi, did you ever get something like this implimented? I have reached part of my project that needs this so would be great to have it all in one solution.