Skip to content

round function doesn't work as expected in Python #47

Open
@ikaradogan

Description

@ikaradogan

The round function takes one or two parameters in Python and one parameter in JavaScript. In Flexx, while using round with two parameter in PyWidget, the program does not fail, but in JS Widget it fails.

        rounded1 = round(number)
        # works with one parameter as expected either in Python or JavaScript

        rounded2 = round(number, decimals)
        # doesn't work on JS Widget, but works in PyWidget

        rounded3 = number.toFixed(decimals)
        # as toFixed is a JavaScript method that formats a number, it works on JS Widget,
        # but with a non-negative parameter and it gives fixed decimal digits

From what i see this line may need to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions