Skip to content

Inaccurate results when comparing floats values with the floats saved in contenttype #3461

@abdellahrk

Description

@abdellahrk

when doing a search with the where clause, fetching contents whose values of amount is <= 5 or <=5.0 returns contents with amount values of 5.3 or 5.1.

amount: 
  type: number 
  mode: float

Details

Question Answer
Relevant Bolt Version 5.1
Install type Composer
BC Break no
PHP version 8.1
Web server Nginx
For UX/UI issues Chrome/Firefox/Edge

Reproduction

Bug summary

When doing a search with the where clause, fetching contents whose values of amount is <= 5 or <=5.0 returns contents with amount values of 5.3 or 5.1.

Steps to reproduce

Doing a search with where clause.

Expected result

The expected result should be content with amount less than or equals to 5. Rather, contents greater that 5 are returned as well like `5.-`.

Actual result

The actual results are contents including `5.-` which is greater than 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions