I want to add the ability in a post to ask the user to enter a value(s). Based on that value I want to return several calculated answers.

Example:

Ask user to enter perimeter (in inches)

Ask user for number of whipped inches

Ask user for length of strand used (in inches)

Calculate number of strands = perimeter / number of whipped inches

Calculate number of feet = (number of strands * length of strand used)/12

Calculate number of yards = number of feet /3

perimeter = 95

number of whipped inches = 4

length of strand = 60

strands = 24 (round up)

feet = 120

yards = 40 (round up if needed)

I know I need a function and some form html but I'm not sure how to put it all together and have it show in a post. This is something I think I will customize for several other things.

In case you are wondering, the calculation is used to figure out how much yarn you will need to whip the edge of a hooked rug. This is a mystery to many of my visitors and when they hear the math, some will just zone out. If I could offer a calculator I am offering a useful tool and could increase my traffic.

I could modify and reuse the code to calculate changes in dye quantities when dyeing wool, how much wool you will need to hook an area, how much it will cost to purchase wool for a certain sized rug . . .