PHPackages                             ecommunities/ecms-number-format - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ecommunities/ecms-number-format

ActiveComponent[Utility &amp; Helpers](/categories/utility)

ecommunities/ecms-number-format
===============================

jQuery plugin for input field number formatting and validation

v0.5.0(11y ago)021MITJavaScript

Since Feb 16Pushed 11y ago1 watchersCompare

[ Source](https://github.com/ecommunities/ecms-number-format)[ Packagist](https://packagist.org/packages/ecommunities/ecms-number-format)[ Docs](https://github.com/ecommunities/ecms-number-format)[ RSS](/packages/ecommunities-ecms-number-format/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (7)Used By (0)

ecmsNumberFormat jQuery plugin
==============================

[](#ecmsnumberformat-jquery-plugin)

\#####jQuery Plugin for Input Field Number Formatting MIT license: \[\]

Author: Kevin Farley / eCommunities / \[\]

GitHub: \[\]

This plugin allows you to provide visual validation of a numeric input field (input, number) via addition/removal of classes both during editing, and after leaving the field. In the *standard declaration* below, we demonstrate how you can validate against a variety of criteria without impeding a users ability to enter data in their own way, and then force the field to update to the closest valid value upon losing focus. Criteria currently include: \*\**min*\*\*imum value, \*\**max*\*\*imum value, \*\**dec*\*\*imal precision, and \*\**inc*\*\*rement, but the to-do's include the ability to add additional filters via **Regex** strings, feel free to fork and PR to lend a hand!

### Configuration Parameters

[](#configuration-parameters)

- @param float|null **min** *The minimum value to allow*
- @param float|null **max** *The maximum value to allow*
- @param int **dec** *The number of decimal places to fix the value to*
- @param float **inc** *The increment value to match to*
- @param string **valid** *Class name to be added when value is valid (only while field has focus)*
- @param string **invalid** *Class name to be added when value is invalid (only while field has focus)*

##### Alternate Field Attribute Parameters

[](#alternate-field-attribute-parameters)

*Overrides call time parameters*

- **min** (text|number)
- **max** (text|number)
- **step** (number)

##### Alternate Field Data-Attribute Parameters

[](#alternate-field-data-attribute-parameters)

*Overrides attribute parameters*

- **data-min**
- **data-max**
- **data-dec**
- **data-inc**
- **data-valid**
- **data-invalid**

### Configuration Examples:

[](#configuration-examples)

```
// Defaualt formatting, no decimals, increment by one, no min or max.
var numOpts = {}

// No min or max, fix to two decimals and round to multiples of 0.25.
var numOpts = { dec:2, inc:0.25 };

// Enforce a minimum of 1000 and a maximum of 2000, with no decimals, and increment by one.
var numOpts = { min:1000, max:2000 };

// The kitchen sink.
var numOpts = { min:1000, max:2000, dec:4, inc:0.0025, valid:'valid-class', invalid:'invalid-class' };
```

### Standard Declaration:

[](#standard-declaration)

```
$('#foo').on('keyup paste change', function() { $(this).ecmsNumberValidate(numOpts); });
$('#foo').on('blur', function() { $(this).ecmsNumberFormat(numOpts); }).blur();
```

TO-DO's
-------

[](#to-dos)

- allow precision to be forced in output (i.e. trailing zeros in html5 number field)
- add support for more numerical types (i.e. scientific notation)
- add support for custom match regex queries in addition to standard options
- add support for helpful error messages
- add example html file + test files / cases

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

4097d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7cb7a9f514cf2518410cc5edaea26b607331ef14ac092327b30b0f346848db66?d=identicon)[ecommunities](/maintainers/ecommunities)

---

Top Contributors

[![oucil](https://avatars.githubusercontent.com/u/3843802?v=4)](https://github.com/oucil "oucil (38 commits)")

### Embed Badge

![Health badge](/badges/ecommunities-ecms-number-format/health.svg)

```
[![Health](https://phpackages.com/badges/ecommunities-ecms-number-format/health.svg)](https://phpackages.com/packages/ecommunities-ecms-number-format)
```

###  Alternatives

[fullcalendar/fullcalendar

Full-sized drag &amp; drop event calendar

20.4k373.3k4](/packages/fullcalendar-fullcalendar)[eternicode/bootstrap-datepicker

A datepicker for Bootstrap

12.7k543.8k6](/packages/eternicode-bootstrap-datepicker)[vakata/jstree

jsTree is jquery plugin, that provides interactive trees.

5.2k1.8M11](/packages/vakata-jstree)[eonasdan/bootstrap-datetimepicker

Date/time picker widget based on twitter bootstrap

7.2k492.4k9](/packages/eonasdan-bootstrap-datetimepicker)[rmm5t/jquery-timeago

jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").

3.8k174.2k2](/packages/rmm5t-jquery-timeago)[mottie/tablesorter

tablesorter (FORK) is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.

2.6k223.5k](/packages/mottie-tablesorter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
