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

number min/max/greater/less do not allow decimal values #609

Closed
Justin-Kuehn opened this issue Mar 17, 2015 · 1 comment
Closed

number min/max/greater/less do not allow decimal values #609

Justin-Kuehn opened this issue Mar 17, 2015 · 1 comment
Labels
bug Bug or defect
Milestone

Comments

@Justin-Kuehn
Copy link

This:

var Joi = require('joi');
Joi.number().min(0.1).required()

Throws:

Error: limit must be an integer
    at Object.exports.assert (.\node_modules\joi\node_modules\hoek\lib\index.js:678:11)
    at internals.Number.greater (.\node_modules\joi\lib\number.js:83:10)
    at Object.<anonymous> (.\test.js:6:27)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
    at Function.Module.runMain (module.js:490:10)
    at startup (node.js:124:16)
    at node.js:807:3

The same happens with max, greater, and less.

@Justin-Kuehn
Copy link
Author

I made a pull request here: #610

Thanks!

@Marsup Marsup added the bug Bug or defect label Mar 18, 2015
@Marsup Marsup self-assigned this Mar 18, 2015
@Marsup Marsup added this to the 6.1.0 milestone Mar 18, 2015
Marsup added a commit that referenced this issue Mar 23, 2015
Marsup added a commit that referenced this issue Mar 23, 2015
@Marsup Marsup closed this as completed Mar 23, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants