Talos v0.3.1 Talos.Types.FloatType View Source
Type for check value is float
For example:
iex> percents = %Talos.Types.FloatType{gteq: 0, lteq: 100}
iex> Talos.valid?(percents, 42.0)
true
iex>Talos.valid?(percents, 136.0)
false
Additional parameters:
allow_nil
- allows value to be nil
allow_blank
- allows value to be blank (0.0)
gteq
- greater than or equal, same as >=
lteq
- lower than or equal, same as <=
gt
- lower than, same as >
lt
- lower than, same as <
Link to this section Summary
Functions
Callback implementation for Talos.Types.errors/2
.
Callback implementation for Talos.Types.valid?/2
.
Link to this section Types
Link to this section Functions
Link to this function
errors(type, value)
View Sourceerrors(Talos.Types.FloatType.t(), any()) :: [String.t()]
Callback implementation for Talos.Types.errors/2
.
Link to this function
valid?(type, value)
View Sourcevalid?(Talos.Types.FloatType.t(), any()) :: boolean()
Callback implementation for Talos.Types.valid?/2
.