MCPcopy Create free account
hub / github.com/kataras/iris / PostValueFloat64

Method PostValueFloat64

context/context.go:2204–2211  ·  view source on GitHub ↗

PostValueFloat64 returns the last parsed form data matches the given "name" key from POST, PATCH, or PUT body request parameters as float64. See ErrEmptyForm, ErrNotFound and ErrEmptyFormField respectfully.

(name string)

Source from the content-addressed store, hash-verified

2202//
2203// See ErrEmptyForm, ErrNotFound and ErrEmptyFormField respectfully.
2204func (ctx *Context) PostValueFloat64(name string) (float64, error) {
2205 value, err := ctx.PostValueString(name)
2206 if err != nil {
2207 return 0, err
2208 }
2209
2210 return strParseFloat64(value)
2211}
2212
2213// PostValueFloat64Default same as PostValueFloat64 but if errored it returns
2214// the given "def" default value.

Callers 1

Calls 2

PostValueStringMethod · 0.95
strParseFloat64Function · 0.85

Tested by

no test coverage detected