Skip to content

itsMeBender/kgui-single-digit

Repository files navigation

Published on webcomponents.org

Manipulating a single and multiple digits.

<kgui-single-digit></kgui-single-digit>
<kgui-multi-digits></kgui-multi-digits>

Introduction

Manipulate a single or multiple digits, with mouse (touch). Why? Because keyboard usage creates an overlay for the keyboard on the app, hiding too much info. This will be handy for small corrections of a number, like an INR value or dosing pills.

Localization of decimal mark

The presentation of a number can be subject of localization, expecially when it concerns the DECIMAL MARK. A decimal mark is presented by a DOT or COMMA and is the divider of the fractional part of a number. The kgui-multi-digit-element number attribute supports both.

But, only the LOCAL presentation is used, in the number feedback.

This means, that the value of element.getAttribute('number') is localized. Containing a COMMA for some European countries. And DOT for other international standards, like JavaScript. You can use the element._number property, to access the JavaScript Number value.

There is no automatic support for the thousand divider. Officially it is a SPACE. But using the format attribute, you are free to use you own divider. For example '##-###-##'.

Specifications

  • Single digit manipulation.
  • Multiple digits manipulation, using <kgui-multi-digits number="123">.
  • Localization of the decimal-mark.
  • Allow large number formatting, using (thousand) dividers.
  • Number format also defines maximum size of the number. As in the format ###, with number range from 0 .. 999.
  • Currently only positive numbers are supported!

See also wiki.

About

Manipulation of a single or multiple digits on screen.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages