5 ms·
My weekend project: accounting.js, tiny JS library for money/currency formatting
- jsavimbi 15y agoWell thank you very much, sir.
- yannis 15y agoNice project. Check also some of the i18n classes in Google's Closure package (http://code.google.com/closure/library/ http://code.google.com/closure/library/), for more comprehensive routines and support for almost any currency.
- josscrowcroft 15y agoSweet, thanks for the link - I'll read through it and see if I can improve or expand the library.
- beck5 15y agoThanks, for me it makes sense to use the smallest unit available as the main unit, i.e. cents not dollars / pence not pounds.
- veyron 15y agoWhat are you using for minifying the javascript?
- josscrowcroft 15y agoYUI - via http://refresh-sf.com/yui/ http://refresh-sf.com/yui/ when I'm in a hurry. Why, did you find errors, or room for improvement?
- veyron 15y agoJust curious. I'm not really a JS person
- cdsanchez 15y agoI think it'd also be useful if you included an enumeration of the common currency symbols. For example, accounting.DOLLAR, accounting.EURO, etc.
- josscrowcroft 15y agoYeah, that could work actually - I've purposefully left everything to do with symbols (apart from the standard dollar sign) up to the developer, to avoid bloat, but I can see a use case for the most common ones (along with default formatting for said symbols)