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

Method PostValueFloat32

context/context.go:2180–2187  ·  view source on GitHub ↗

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

(name string)

Source from the content-addressed store, hash-verified

2178//
2179// See ErrEmptyForm, ErrNotFound and ErrEmptyFormField respectfully.
2180func (ctx *Context) PostValueFloat32(name string) (float32, error) {
2181 value, err := ctx.PostValueString(name)
2182 if err != nil {
2183 return 0, err
2184 }
2185
2186 return strParseFloat32(value)
2187}
2188
2189// PostValueFloat32Default same as PostValueFloat32 but if errored it returns
2190// the given "def" default value.

Callers 1

Calls 2

PostValueStringMethod · 0.95
strParseFloat32Function · 0.85

Tested by

no test coverage detected