Abstract
This is a classic example where you sell a product by square meters, product price is setup in square meters too, but let the customer choose what is the unit of entered values.
Remember this is only a sample, we reccomend you to check value limits in your real product, we have some demos in that way.

The trick is that we have a selectbox with options in order to choose the unit, every text in those options is recognized by CFO_UnitConversion which performs the conversion (lines 10 and 11).
You can do it without this function of course, may be using a “switch” to detect selected option. (Take a look at this example: Selling printed banners)

Used function to unit conversion
CFO_UnitConversion

// Get entered values
$cuWidth = {26V};
$cuHeight = {27V};

// We will use the text in the select box to detect selected unit
// So use it as a string with quotes
$cuUnits = "{25T}"; 

// Convert values to our reference unit (meters)
$ourWidth = CFO_UnitConversion($cuWidth, $cuUnits, "meters");
$ourHeight = CFO_UnitConversion($cuHeight, $cuUnits, "meters");

// Calculate square meters and assign final price
$FinalPrice = $ourWidth * $ourHeight * $Price;

// Debug
CFO_ShowDebug(true);

You can visit this demo in our Demo Store