ember-validators icon indicating copy to clipboard operation
ember-validators copied to clipboard

Allow to use coma in numbers

Open GCorbel opened this issue 9 years ago • 7 comments

In french, and in some other languages, coma are used instead of dos to separate numbers.

Not sure about the implementation but I didn't found an other way.

GCorbel avatar Nov 19 '16 12:11 GCorbel

@GCorbel I agree with you, this is certainly an issue I havent faced yet. Im not really sure if this is the best approach though or if it will break anything upstream.

offirgolan avatar Nov 19 '16 22:11 offirgolan

It works for me. We may have an option like allowComas: true. What you think ?

GCorbel avatar Nov 20 '16 00:11 GCorbel

@offirgolan I need your feedback for one project. Please, let me know if you think my proposition is good or not.

GCorbel avatar Nov 22 '16 11:11 GCorbel

@GCorbel I'm sorry but I'm on vacation and I dont have time to check this logic out for the next 2 weeks. If you are using this via ember-cp-validations, you have multiple ways of doing this with public API.

  1. You can create your own number validator by extending the existing one.
  2. You can use the value option to format the number string.

Hopefully that will unblock you until I have more time to verify this PR.

offirgolan avatar Nov 23 '16 07:11 offirgolan

@offirgolan This PR looks relatively straightforward, any chance we can get it merged?

acorncom avatar Jun 28 '17 14:06 acorncom

@GCorbel can we put this behind an allowComas flag?

offirgolan avatar Jun 30 '17 17:06 offirgolan

@offirgolan sorry for late answer. I will check it this weekend I hope.

GCorbel avatar Jul 15 '17 00:07 GCorbel