Open valtido opened 8 years ago
Agree. A little wrapper interface around some locale based conventions would be a winner. Something like: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat with the currency option? Having your standalone lib support this would be great for cross browser compatibility.
I think instead of providing settings as you do, under
accounting.settings
you should probably think about,accounting.locale = "en-GB"
oraccounting.locale = "en-US"
etc etc... so we can slowly populate and represent for each country.One thing you would have to bare in mind is that some countries allow more than one format or currency, so that should be taken into account.
All I'm saying is abstract the need to change the settings so generally as this is more error prone than that of a pre-defined settings/configs.
I really like this library other wise :)