gardens-ui icon indicating copy to clipboard operation
gardens-ui copied to clipboard

Fields that take a number supports scientific notation

Open onbjerg opened this issue 4 years ago • 5 comments

Fields that take a number generally accepts scientific notation (e.g. 1e18 or just e) and other "invalid" inputs such as "-10" and so on.

Areas affected:

  • When supporting a proposal initially
  • When creating a funding proposal
  • When changing support

Low priority bug since the user will have to input this intentionally and transactions will revert in the case that the number is out of range (amount < 0 or amount > balance).

Credit to @anthonyoliai for reporting it on Discord first

onbjerg avatar Oct 22 '20 01:10 onbjerg

Same issue in honeycomb as well

subbu0x0 avatar Oct 22 '20 13:10 subbu0x0

Hey @onbjerg,

-Founding proposal,

  • for negative numbers when you loose the focus, the field is cleaned.
  • for scientific notation this is what it shows Screen Shot 2020-10-25 at 11 27 47 AM

Should we clean the field as negative numbers?

famole avatar Oct 25 '20 14:10 famole

Yes, it doesn't make sense to have an infinite request amount, the transaction will just revert. Sorry for the delayed response.

onbjerg avatar Oct 29 '20 10:10 onbjerg

It was solved? Need help?

kamikazebr avatar Dec 19 '21 18:12 kamikazebr

I made some tests to undestand, the test below pass.

image

Its look correct?

So if find some e or minus need be 0 value, right? Test which pass below image

@0xGabi @famole

kamikazebr avatar Dec 19 '21 22:12 kamikazebr