User:Crunch41/sandbox

I came across an error message when trying to create a weather box. Any box with |Jan precipitation inch = trace will give an error. The same error also appears when |Jan rain inch = trace. Snowfall and metric units are not affected. A temporary fix can be made by changing the units for January to mm or cm. Since the value is only a trace, the change is not visible to the reader and does not change the yearly sum.

The error traces back to the code for Module:Weather_box. Lines 203 and 214

203:prefer_cm = precision(_ifset('Jan precipitation inch', '0')) < 1,

214:prefer_cm = precision(_ifset('Jan rain inch', '0')) < 1,

This box has Jan precipitation inch = trace

Any other month can be a trace, as long as January is not "trace". I tried a blank entry, a short text string "cat", and numbers. Deleting the row completely also does not cause an error. "trace" is the only value I found to cause an error.

This box has all months as a trace, but January has units of mm. This could be used as a workaround for the rare case it is needed.

The same problem happens with Jan rain inch = trace.

Other months can have trace rainfall.

This does not happen with trace snowfall.

This also does not happen with metric units (mm or cm).