Does Solidity supports floating point number
10,054
Solution 1
There is no floating point in Solidity. You should keep numbers in whole number format.
You can place decimal place in your front-end code. Take a look at how ERC20 contract was designed.
Good read: https://medium.com/@jgm.orinoco/understanding-erc-20-token-contracts-a809a7310aa5
Solution 2
There is no native support for floating-point numbers in the core language, but they are available via libraries, such as ABDKMathQuad.
Related videos on Youtube
Comments
-
Anijit Sau almost 2 years
I am new in solidity language. Have seen their documentation. Is there any
floating point
data type ? -
Pro Q over 2 yearsUnfortunately the library you link to looks like it's under copyright, so it cannot be used.
-
Agna JirKon Rx over 2 years@Pro Q - true fact