0.2.3 • Published 3 years ago

ng-calc-input v0.2.3

Weekly downloads
53
License
ISC
Repository
github
Last release
3 years ago

NgCalcInput

NgCalcInput is a simple input that allows only for the input numbers at the given precision.

Installation

$ npm i ng-calc-input

Example Usage

app.component.html:

<label>
  Number:
  <input type="text" calc-input="5.3" [formControl]="numberInput" (keyup)="test($event)">
</label>
<p>Value: {{ numberInput.value }}</p>

app.component.ts:

export class AppComponent {
  title = 'ng-calc-input-demo';
  numberInput = new FormControl('0');

  public test(event: Event) {
    console.log(event);
  }
}

Styling is left up to the consumer.

The input does only allows numbers and '.'.

Input type must be "text". The first number is the number of allowed characters before the decimal. The second number is the precision after the decimal.

So the above code will only allow a number like: 55555.333

0.1100.1

3 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.0

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago