Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preventing negative numbers #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Preventing negative numbers #8

wants to merge 2 commits into from

Conversation

searls
Copy link

@searls searls commented Dec 8, 2010

On my project, we very often need to restrain users to positive numbers, so I changed numeric() to take an object literal. Another change I might make in the future is another option to universally allow a keystroke if a modifier key (i.e. alt/ctrl/cmd) is held down.

I realize that this signature change would break backwards compatibility, but I think the object literal with an explicit config would make the options more apparent to users (I got stuck trying to declare no decimal by specifying '' at first).

…imal' (previously the first parameter), as well as 'negative', a boolean which allows the user to decide whether negative numbers should be allowed.
@maniserowicz
Copy link

i did the same thing, would be good to see it in master

@searls
Copy link
Author

searls commented Jan 31, 2011

Hi Sam, I just added this commit to try to ensure BC (check if the first param is a boolean and wrap it in the appropriate property of the new config object: searls@a637a3a

@drewfreyling
Copy link

Is this still planned for a major revision?

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

Successfully merging this pull request may close these issues.

4 participants