Questions tagged [decimals]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
21 views

Why do almost all of the ERC20 tokens have even number of decimals?

I'm thinking of creating a token with a decimal point of odd number. However I'm kind of worried if there is any issue that can be caused by using an odd number for the decimal point. Is there any ...
0
votes
1answer
17 views

How to calculate the right amount of a token to use in 0x quote endpoint

I'm trying to use 0x to buy tokens with ETH. I'm following the sample at https://0x.org/docs/guides/swap-tokens-with-0x-api#swap-eth-for-1-dai. I got the token address, and the decimals. let's say ...
0
votes
0answers
11 views

IERC1155Views - whether and how to use it?

Do I need to have IERC1155Views interface in my ERC-1155 contract to determine the number of decimals after the dot for the exchanges? If I don't specify IERC1155Views, what number of decimals will ...
1
vote
1answer
29 views

Why don't decimals work in solidity?

I've read this question and answer thread about representing decimal values in solidity, and I understand that math is entirely done using fixed-point. However, I'm curious as to why this is the case. ...