4
votes

I am new in solidity language. Have seen their documentation. Is there any floating point data type ?

2

2 Answers

5
votes

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

2
votes

There is no native support for floating-point numbers in the core language, but they are available via libraries, such as ABDKMathQuad.