Inches bind a form field to a float64 variable. It populates an error if the value cannot be computed back to inches. var foo float64 ctx.FormData().Inches("foo", &foo, 2.0)
(key string, target *float64, defaultValue float64)
| 171 | // |
| 172 | // ctx.FormData().Inches("foo", &foo, 2.0) |
| 173 | func (form *FormData) Inches(key string, target *float64, defaultValue float64) *FormData { |
| 174 | form.inches(key, target) |
| 175 | if *target == -math.MaxFloat64 { |
| 176 | *target = defaultValue |
| 177 | } |
| 178 | return form |
| 179 | } |
| 180 | |
| 181 | // MandatoryInches binds a form field to a float64 variable. It populates |
| 182 | // an error if the value cannot be computed back to inches, is empty, or the |