Skip to content
This repository has been archived by the owner on Oct 31, 2018. It is now read-only.

Formatted amounts #16

Open
bragi opened this issue Dec 12, 2012 · 3 comments
Open

Formatted amounts #16

bragi opened this issue Dec 12, 2012 · 3 comments
Assignees
Labels

Comments

@bragi
Copy link

bragi commented Dec 12, 2012

Allow to paste formatted amount, eg. "36.00zł"

@ghost ghost assigned c2h5oh-Ruby Dec 16, 2012
@c2h5oh-Ruby
Copy link
Contributor

Which formats should we consider?
36.00zł
36.00
36,00
36
36 zł
36,00 PLN
any else?

@smt116
Copy link
Contributor

smt116 commented Dec 16, 2012

I think that format is not such important, when we will use regex.

@bragi
Copy link
Author

bragi commented Dec 17, 2012

There is a problem with comma vs. dot as this is locale (language) dependant. What's more is that users often tend to paste formats different from their locale and this has to be handled in some meaningful way.

If we go for pure JavaScript solution then user may see changes to his input in the realtime - and I don't think we should bother backend with such details.

We can detect which format (comma/dot) user has in mind by looking how those symbols show up in the number. For example in English 1,499.99$ is a valid number. In Polish this may be written as 1 499,99zł.

One way to to handle this is to throw away non-digits and deduct which sign is used for decimal part based on number of decimal digits.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants