Decimal number input behavior.
that have this behavior applied by default (see master style sheet):
<input type=“decimal” /> - inline single line <widget type=“decimal”></widget> that this behavior knows about:
value=float - initial value of the input elementsize=integer - determines value of (intrinsic and default) width of the element.format - format of number representation, string that accepts following ';'-separated fields:grouping - number, number of digits in “thousand” groups. fdigits - number, fractional digits to show. leading-zero - true/false, show leading zero. decimal-sep - string, separator between integer and fractional parts. grouping-sep - string, separator between groups. negative-sign - true/false, true - show '-', false - wrap digits by '(' ')' characters.example:
format="grouping:3; fdigits:4; leading-zero:false; decimal-sep:','; thousand-sep:'_'; negative-sign:false"
format attribute can also be defined in CSS as a custom attribute -format.
Thus you may define it for group of input elements as:
input.decimal
{
behavior:decimal;
-format="fdigits:2; leading-zero:true;"
}
The behavior supports following xcall() methods (see dom::element::xcall() function):
xcall(“min”): int - returns min limit;xcall(“min”, v:int) - sets min limit;xcall(“max”): int - returns max limit;xcall(“max”, v:int) - sets max limit;xcall(“step”): int - returns step value;xcall(“step”, v:int|undefined) - sets/clears step;Together with the standard set of events (mouse, keyboard, focus) behavior: button generates:
type json::value::V_FLOAT, reflects current status of internal editing buffer.
See edit