Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
My weekend project: accounting.js, tiny JS library for money/currency formatting (josscrowcroft.github.com)
28 points by josscrowcroft on Aug 21, 2011 | hide | past | favorite | 9 comments


Nice project. Check also some of the i18n classes in Google's Closure package (http://code.google.com/closure/library/), for more comprehensive routines and support for almost any currency.


Sweet, thanks for the link - I'll read through it and see if I can improve or expand the library.


I think it'd also be useful if you included an enumeration of the common currency symbols. For example, accounting.DOLLAR, accounting.EURO, etc.


Yeah, 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)


Thanks, for me it makes sense to use the smallest unit available as the main unit, i.e. cents not dollars / pence not pounds.


What are you using for minifying the javascript?


YUI - via http://refresh-sf.com/yui/ when I'm in a hurry.

Why, did you find errors, or room for improvement?


Just curious. I'm not really a JS person


Well thank you very much, sir.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: