Gate count and gate width do different jobs
The current form takes a gate count and one shared gate width in feet. The calculation uses their product to deduct openings from the measured run. It separately uses the count to add a pair of planning posts for each gate.
net run = max(0, total length − gate count × gate width)
posts = ceil(net run ÷ post spacing) + 1 + (gate count × 2)
That separation means the entries are not interchangeable: setting the count to zero disables both gate effects; entering a positive count with a zero width keeps the full run but retains the gate-post allowance.
Controlled examples from the current calculator
The cases below use a hypothetical 100 ft run, 8 ft post spacing, and the listed gate entries. They were run through this site's submit handler; they are examples of code behavior, not a recommended layout or a materials order.
| Gate count | Shared width | Net run | Posts |
|---|---|---|---|
| 0 | 0 ft | 100 ft | 14 |
| 1 | 0 ft | 100 ft | 16 |
| 1 | 4 ft | 96 ft | 15 |
With no gates, the straight run needs 13 sections at the entered spacing and 14 posts under this formula. A counted zero-width gate leaves those 13 sections intact, then adds two posts. A four-foot opening shortens the run to 96 ft, which rounds to 12 sections; the gate allowance brings the result to 15 posts.
Check the entries against the measured openings
- If the project has no gate openings, set the gate count to zero.
- If it has openings, enter their count and the width represented by the form's shared-width field.
- If the openings have different widths, this form cannot enter a separate width for each one. See the gate-input scope guide for that limitation.
A zero width can be a valid numeric input to the form but still fail to describe a real opening. Treat this check as a way to catch mismatched entries, not as confirmation of gate support or final post placement.
Method and source
This explanation follows the gate fields in the current calculator and the net-run and post expressions in its calculation code. The three table rows were verified by submitting those inputs to the current handler. The page adds no construction standard, product specification, or price data.