Skip to content

Added ability to validate the number of decimal places#427

Merged
hueniverse merged 4 commits intohapijs:masterfrom
rtomlinson:master
Sep 19, 2014
Merged

Added ability to validate the number of decimal places#427
hueniverse merged 4 commits intohapijs:masterfrom
rtomlinson:master

Conversation

@rtomlinson
Copy link

We needed this to help validate currency fields to ensure that the correct level of precision was presented.

Richard Tomlinson added 4 commits September 15, 2014 22:00
Signed-off-by: Richard Tomlinson <richard.tomlinson@matchesfashion.com>
Signed-off-by: Richard Tomlinson <richard.tomlinson@matchesfashion.com>
Signed-off-by: Richard Tomlinson <richard.tomlinson@matchesfashion.com>
Signed-off-by: Richard Tomlinson <richard.tomlinson@matchesfashion.com>
@hueniverse hueniverse added the feature New functionality or improvement label Sep 19, 2014
@hueniverse hueniverse added this to the 4.7.0 milestone Sep 19, 2014
@hueniverse hueniverse self-assigned this Sep 19, 2014
hueniverse pushed a commit that referenced this pull request Sep 19, 2014
Added ability to validate the number of decimal places
@hueniverse hueniverse merged commit 97c6754 into hapijs:master Sep 19, 2014
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the regex out gives about 2-4% performance boost.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did you measure that? running the tests against the two versions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running the isolated code using bench.

hueniverse pushed a commit that referenced this pull request Sep 19, 2014
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants