npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

numeric-formatter

v1.2.4

Published

Set character lengths for html numeric inputs. Unlike using regex pattern with html input type text this will validate user inputs on type..

Downloads

24

Readme

Set character lengths for html numeric inputs. Unlike using regex pattern with html input type text this will validate user inputs on type..


Features

  • Set character lengths for html numeric inputs;
  • Set maximum and minimum decimal points counts;
  • Mask numbers with thousands seperators without changing the original value;
  • Validations will be happening on user input;
  • More features to add.;

$ npm install numeric-formatter

*** Required : Angular two way binding for the input***

####AppModule

import { NgModule } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { NumericFormatterModule } from 'numeric-formatter';
 
 @NgModule({
  imports: [ FormsModule, NumericFormatterModule]
})

####HTML

<input numericformatter [(ngModel)]="value" [maxNumLength]="10" 
			[minDecimals]="3" [maxDecimals]="4" [displaySeperator]="true"/>

####Properties

| Name | Type | Default | Description | | ------------- | ------------- | ------------- | ------------- | | maxNumLength | number | 100 | Fix the character length that can be type (Including decimal seperator, excluding thousand seperator) | minDecimals | number | 0 | Minimum decimal points for the input | | maxDecimals | number | 100 | Maximum decimal points that can be typed | | displaySeperator | boolean | false | Show thousand seperators for the input value (will not change the original value) | | maxValue | number | null | Defines the maximum numeric value that can be typed | | minValue | number | null | Defines the minimum numeric value that can be typed (will be default to minimum value on validation) | | allowNegative | boolean | false | Negative numbers will be allowed to type |


Changelog

1.2.4

  • Fixed an issue with decimal pipe is not being applied when value is zero;

1.2.3

  • Fixed an issue with unable to overwrite text by selecting all when max length is reached;

1.2.2

  • Fixed an issue with decimal pipe provider for angular version 7;

1.2.1

  • Fixed an issue with not pasting numbers with new line at the end;

1.2.0

  • Adding minValue property for minimum numeric value validation;

1.1.1

  • Fixed an issue with negative numbers are allowed in allowNegative false state;

1.1.0

  • Added support for negative numbers;

1.0.7

  • Fixed an issue with module not found;

1.0.6

  • Fixed an issue with not getting selected on tab focus;

1.0.5

  • Adding maxValue property for maximum numeric value validation;

1.0.4

  • Fixed an issue with exceeding character limit on long key press;
  • Fixed an issue with enabled space key;

1.0.3

  • Changed decimal points property name to max decimals;
  • Fixed an issue with displaying bound values;

1.0.2

  • Fixed an issue with exceeding character limit when decimal points property not defined;

1.0.1

  • Added a input property to show/ hide thousand seperator;

1.0.0

  • Initial release;