Hello File Maker brothers and sisters

I have a bit of a issue. I am trying to build a script that will allow me to convert measurements from imperial to metric and I am having trouble getting the script correct. Is anyone able to help me in this issue?

Thank you.

Before you consider a script, think in terms of data and relationships.

You can set up a table of conversion factors such as 2.54 cm in a pair of fields and 1 in in another pair of fields in the same record.

You can then set up a relationship that matches by desired units (input and output) with a calculation that then references the correct value to use to convert from one to the other. This method can work for any unit conversion where 0 represents the same quantity in both measurement systems. (Can't use it for temperatures)

CalculationTable::UnitsImperial = ConversionFactors::unitsimperial AND

CalculationTable::UnitsMetric = ConversionFactors::UnitsMetric

Then CalculationTable::ImperialValue * ConversionFactors::MetricFactor

Can compute the metric equivalent. In our example, 2 inches * 2.54 cm/in yields 3.08 cm