# Comparing a `uint` with a `ufixed`

I need to make sure that the value being sent to my contract is at least a certain amount. To do this I need to be able to compare the value with a `ufixed`:

``````require(msg.value > previousValue * 1.1)
``````

but I'm getting the following error:

`TypeError: Operator > not compatible with types uint256 and ufixed128x18`

What's the right way to do this?

Thanks

Using `1100000000000000000` in place of `1.1` should solve your issue, however when scaling values like this, you must make sure that you scale all values accordingly so you don't get weird truncation, or unexpected results.

How can I perform float type division in solidity?

Best way to do USD math in Solidity?

• Thanks! Could you explain why I have to divide the final result by `1 ether` please? May 18, 2018 at 18:21
• Hey sorry I mis-typed, you don't always have to divide the final result by `1 ether` you just have to make sure that when you scale one value, you scale all the other values accordingly. May 18, 2018 at 18:24
• Ah okay, thanks. What scaling is being used here? Why does this solve the problem? Know where I can go to read up about this stuff? May 18, 2018 at 18:33
• The reason you need to scale that value is because the EVM has no usable concept of fixed point integers, nor would you even want to use them. Therefore you need to have a method to handle those values. I personally convert everything "into base of wei". Say for example your number `1.1` to convert that "into base of wei" you can go to a website like this (etherconverter.online), input `1.1` into the `ether` field, and take the value from the `wei` field. Or just mulitply your value by `10**18`. May 18, 2018 at 18:35
• I'll include some links in my post that will help May 18, 2018 at 18:36

Think out of the box:

``````require(msg.value > previousValue * 11 / 10)
``````