### Title

Field Calculation problem~

### Post

Dear all

I have build up two field, one is for imperial and the other one is metric, how can I set up the calculation function to build its relation?

For example, if I type 1 inch in imperial field, the metric field will automatic show up 2.54 cm. In opposite, if I type 2.54 cm in the metric field, the imperial field will show up 1 inch.

I have try to use the calculation function in metric field "imperial field= metric field / 2.54". but the problem is I can not type the number in the imperial field and then calculate back.

How can I solve this problem?

Thanks for your help

Ray

If I understand you right, this is how I did this for a feet/meter conversion for my database.

You need four fields.

The first one is lenght_n (number; where someone enters the length)

The second is lengthUnit_t (text; where options from a value list allow "imperial" or "metric"

The third one is lengthMetric_c (a calculation; If(lengthUnit_t ="imperial"; length_n *.304799;length_n)

the fourth is lenghtImperial_c (a calculation; If(lengthUnit_t ="metric"; length_n *3.28084;length_n)

a person enters in the length and the unit using the first two fields and the alternative lengths are calculated by the last two. You could combine the last two fields into a single field using a series of if statements.