openexchangerates / accounting.js

A lightweight JavaScript library for number, money and currency formatting - fully localisable, zero dependencies.
http://openexchangerates.github.io/accounting.js
MIT License
4.95k stars 532 forks source link

default currency format should have a space between symbol and value #11

Closed millermedeiros closed 13 years ago

millermedeiros commented 13 years ago

Google Docs and Microsoft Excel uses this rule for formatting currency, so it should be the standard.

current output: $1,234.56

expected output: $ 1,234.56

wjcrowcroft commented 13 years ago

I definitely agree for my own use cases - I've been making it settings.currency.format = "%s %v" to add the space in there (since adding the settings object, anyhow.)

I'm just wondering whether this also holds true for the majority of potential users of the library. Any thoughts?

mikeBrockington commented 13 years ago

I totally disagree with this - a space between the currency symbol and the value is incorrect, why would you make that the default? On a side issue, I think you need to be more explicit about "Eurpoean" format, since formatting customs vary across Europe, with Great Britain being more like the US standard. Similarly, the default currency symbol is actually the hash-sign, why not use that?

wjcrowcroft commented 13 years ago

Thx for the feedback, that's my point too about not forcing the space after the symbol, but making it an option via the format string.

Agreed about european format. I should know, being british and all :) - it's just for demo purposes though and doesn't affect the codebase at all.

It's easy enough to set the default currency symbol to a hash sign, or anything else for that matter, via settings.currency.symbol.

Cheers!

Also: closing this as it's being addressed in #17, with the improvement of the formatting spec.