float

Description

Wpart responsible for dealing with float values. The input entered in the HTML widget is converted to the float type inside the Erlang Virtual Machine.

The rendered widget is <input type="text" ... />.

Validation

option

format

description

error message

min

Min :: float()

Specifies the lower bound of the input value. If passed value is smaller than the limit, an error occurs.

{smaller_than_min, Input}

max

Max :: float()

Specifies the upper bound of the input value. If passed value is greater than the limit, an error occurs.

{greater_than_max, Input}

format check

N/A

Checks if the passed value is in the correct format (is a float number)

{not_float, Input}

HTML meta-attributes

name

format

description

Formatters

option

format

description

example

precision

integer()

Specifies the float's precision

<wpart:lookup key="some_float" format="float(3) />

Examples

Records definitions

...
{float, [{min, 22.5},
         {max, 33.0}
        %% other parameters
        ]
},
...

HTML tag

<wpart:float OTHER_HTML_ATTRIBUTES />

Wparts/BasicTypes/float (last edited 2009-04-16 08:31:32 by Michal Ptaszek)