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

Rules digits and digits_between don't work with fractional numbers #40264

Closed
sera527 opened this issue Jan 5, 2022 · 2 comments
Closed

Rules digits and digits_between don't work with fractional numbers #40264

sera527 opened this issue Jan 5, 2022 · 2 comments
Labels

Comments

@sera527
Copy link

sera527 commented Jan 5, 2022

  • Laravel Version: 5.2 and later

Description:

I believe that the fix on this issue should not have been approved. The rules now only supports integer values. And this does not match the description in the documentation: "The field under validation must be numeric and must have an exact length of value."

Steps To Reproduce:

<?php

$validator = Validator::make(
    ['fractional_value' => 1.2],
    ['fractional_value' => 'digits_between:1,10']
);
$validator->errors()->first(); // The fractional value must be between 1 and 10 digits.
@driesvints
Copy link
Member

Thanks. I've attempted a PR here: #40278

@driesvints
Copy link
Member

We've merged this and it'll be released next Tuesday. Thanks for reporting.

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

No branches or pull requests

2 participants