pyscript icon indicating copy to clipboard operation
pyscript copied to clipboard

Javascript casts Python's output float into number

Open nwatab opened this issue 3 years ago • 0 comments

Checklist

  • [X] I added a descriptive title
  • [X] I searched for other issues and couldn't find a solution or duplication
  • [X] I already searched in Google and didn't find any good information or help

What happened?

Let's say you want to do some calculation. In Python, 0.1 + 0.9 is 1.0 However, in pyscript, float 1.0 is passed to javascript and it interprets as 1 because Javascript shows it as a Number type. As a user expect to see python's output, 1 seems like int in Python. float + float isn't int in Python. This is supposed to be a bug.

What browsers are you seeing the problem on? (if applicable)

Chrome

Console info

No response

Additional Context

No response

nwatab avatar Aug 09 '22 01:08 nwatab