8000 @Assert\DivisibleBy(0.01) not working · Issue #43345 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
@Assert\DivisibleBy(0.01) not working #43345
Closed
@CharlyPoppins

Description

@CharlyPoppins

Symfony version(s) affected: 5.2.12

Description
Float with value 10.12 fail validation when @Assert\DivisibleBy(0.01)

How to reproduce

git clone git@github.com:CharlyPoppins/sf-bug-with-divisible-by.git

symfony composer install

symfony server:start

POST on https://127.0.0.1:8000/test-model with JSON body
{
    "amount": 10.12
}

Possible Solution

  • I need an additional config in the projet or in php.ini
  • fmod can't handle this kind on test

Additional context
Problem happen in vendor/symfony/validator/Constraints/DivisibleByValidator.php
Capture d’écran 2021-10-06 à 00 16 02

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0