Does web3.js have a function that checks if a value (Number | String | BigNumber) is a valid Ether Value? If not, what might be an efficient way of doing so? Would I have to manually make a function to make sure that the input value doesn't have more than 18 decimals, isn't negative, etc?
My application is using
geth and users will be able to withdraw funds from their balances at any time. Now during the withdraw process, they input the amount they wish to withdraw. To my understanding, These are the characteristics of Ether:
- 18 decimal points
- Greater or equal to zero
I could make a function that measures how many decimal points exist in the users input, but would I be reinventing the wheel?