Skip to content

the round method in the Tools class has an overflow error #111

Description

@MAfarrag

Describe the bug
when trying to round a float value 7.84 to the nearest 0.1 if gives 7.8000000000001

To Reproduce
Steps to reproduce the behavior:

from statista.tools import Tools
value = 7.84
rounded = Tools.round(value, 0.1)
print(rounded)
# 7.8000000000000001

Expected behavior
it should return 7.8

Desktop (please complete the following information):

  • OS: Windows
  • Version 0.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions