alfred2-currencyconverter icon indicating copy to clipboard operation
alfred2-currencyconverter copied to clipboard

Run result through `number_format` to get thousand separators

Open sorbits opened this issue 7 years ago • 2 comments

This makes it easier to read large numbers, e.g. 1,432,678,321.

Without additional arguments number_format will use commas for thousand separates, if you think this may confuse people who run macOS with a different locale setting then I suggest using a thin space (U+2009) as a workaround for (presumably) being unable to get the system’s configured thousand separator.

I was considering also running the suggestion through number_format, e.g. writing currency 50000 D will show 50000 DKK which I would like to see as 50,000 DKK, but that requires a bit of refactoring, as the suggestion is returned from a helper function and used both as title and what is inserted for auto-completion.

sorbits avatar Jun 25 '17 14:06 sorbits

The decimal places are gone. And is it possible to imply inputing numbers with delimiters?

cgjosephlee avatar Aug 29 '17 08:08 cgjosephlee

I updated the commit to keep two decimals.

For input, I have not looked at that part of the source.

sorbits avatar Aug 31 '17 19:08 sorbits