ipysheet icon indicating copy to clipboard operation
ipysheet copied to clipboard

Float turned into int along the way

Open krey opened this issue 6 years ago • 6 comments

Using master

Good: 2019-03-15-130025

Not so good: 2019-03-15-131142

krey avatar Mar 15 '19 17:03 krey

I think this is due to the deserialization on the back-end in Python. When Python receives a number that "appears" to be an integer, it will cast it to integer. The fact that JavaScript does not have integers is annoying... I was thinking that, maybe, instead of having numeric cell type, we should have int and float cell types, and validate the value both on the front-end and on the back-end.

martinRenou avatar Mar 18 '19 08:03 martinRenou

Is there a way to force a fixed number of digits? If I type 2.1 into a cell with numeric_format='0.00' I still get 2.1, not 2.10

krey avatar Mar 18 '19 15:03 krey

Interesting, that is another issue. And it might be easier to fix. I'll see if I can fix this one.

martinRenou avatar Mar 18 '19 15:03 martinRenou

I cannot reproduce your issue, what version are you using? test

martinRenou avatar Mar 19 '19 12:03 martinRenou

Very sorry Martin, was using the wrong env when I wrote https://github.com/QuantStack/ipysheet/issues/92#issuecomment-473959949

krey avatar Mar 19 '19 12:03 krey

No problem! :)

martinRenou avatar Mar 19 '19 12:03 martinRenou