Skip to content

Number validation fails with a valid number (".30") #1806

@steve-deliverr

Description

@steve-deliverr

Context

  • node version: 8.6.0
  • joi version: 15.0.2 (types/hapi__joi: 15.0.1)
  • environment (node, browser): node
  • used with (hapi, standalone, ...): standalone
  • any other relevant information:

What are you trying to achieve or the steps to reproduce ?

I'm trying to validate a positive number, and I expect ".30" to be valid since isNan(".30") == false.

Joi.number().validate(".30")

Which result you had ?

error: ValidationError: "value" must be a number

What did you expect ?

error to be null

Please let me know if you need any additional information.

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions