# How to Handle Decimals and Percentages in Solidity [duplicate]

Decimals and Percentages in Solidity I'm making function about percentage

```function setAddress(uint256 newValue) constant returns(uint256){ // tokenAddress = newAddress; // de a = 0.5; // decimals b = 0.5; value = newValue - 0.06; // value = newValue; return value; }```

## marked as duplicate by Richard Horrocks, Vignesh Karthikeyan, mafrasi2, Achala Dissanayake, IsmaelJun 2 '18 at 21:05

• but I can't find solution – blockangular Jun 1 '18 at 19:48
• There is already number of questions and information about handling decimals and percentages in solidity as it is a common topic. You need to work in uint values so think of how to produce your values with in uint types. For example, ether values are converted to Wei to remove decimals. If the available examples are not helping then I suggest you edit your question to give more information about what you are trying to achieve. – machine-uprising Jun 1 '18 at 20:04

`1 ether = 1000000000000000000 wei`
`1 ether = 1000 finney`
`1 ether = 1000000 szabo`