Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Calculations in transformations View modes: 
User avatar
Member
Member
jembry-eriinc - 6/23/2010 2:44:50 PM
   
Calculations in transformations
I have some numeric fields in documents (products) representing product attributes e.g. surface area stored in square feet. Instead of having two fields (like surfaceArea_sqft and surfaceArea_sqm), I would like to perform a calculation in the transformation e.g.

<td><%# Eval("surfaceArea") %> sq ft, <%# Eval("surfaceArea")*0.09290304 %> sq m</td>

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/24/2010 1:34:36 AM
   
RE:Calculations in transformations
Hi,

It would be easier to use Custom function in a transformation. You will pass the field value to it and made the calculation in the custom function code and return result as you need to.

Best regards,
Juraj Ondrus