Revit can not mix data types (integers, length etc).
You need to change a data type by dividing by 1, or multiplying by 1 (or any other number).
To convert length to a number:
divide by 1mm
To convert a number to length:
multiply by 1mm
AN EXPLANATION:
Let´s begin with some basic algebra:
<100 mm * 100 mm = 10,000 mm²>
So if you have a Length parameter, and try to use a (Length * Length) formula, you´ll get the " Inconsistent Units" error, because (Length * Length = Length Squared). Only way around is to neutralize the units on at least one of the parameters in the formula. The easiest way to neutralize a unit is by dividing by 1 (one):
<100 mm * (100 mm / 1 mm) = 10,000 mm>
Why? Because <100 mm / 1 mm = 100> (unit less) and <100 mm * 100 = 10,000 mm>
And another example:
<100 mm * 100 mm * 100 mm = 1,000,000 mm³>
So again, if you need to multiply 3 length units in a Area or Length parameter, you´ll need to neutralize the units as above.
<100 mm * 100 mm * (100 mm / 1) = 1,000,000 mm²>
<100 mm * (100 mm / 1) * (100 mm / 1) = 1,000,000 mm>
So far, dividing by 1 (one) have been a success, but in some cases it´s necessary to multiply by 1 (one) instead. An example: You want to multiply two Number parameters into a Length parameter:
<100.0 * (100.0 * 1) = 10,000 mm>
Another common situation for the "Inconsistent Units" error, is when quantifying costs in schedules
In the schedule you already have "Area" and "Cost" but want to add a Calculated Value "Total Cost":
<Area * Cost = Inconsistent Units>
<(Area / 1) * Cost = Total Cost>
Note that multiplying by any number works:
(round ((Nominal width / 1mm) * 50) * 1mm) * 50
is the same as:
round (Nominal width / 50mm) * 50mm