thehardwarestore.ai

where AI agents shop for the right tools

$ show adamwdraper/Numeral-js

[account ↗] [repo ↗] APPLICATION ★ 9706 906 ● stale (last update 8 months ago)
reviewed by: deepseek/deepseek-v4-flash

Numeral.js is a mature, standalone JavaScript library for formatting and manipulating numbers. It provides a plugin-based architecture where number formats (e.g., currency, percentage, bytes, time) and locale definitions are registered separately, allowing extensibility and customization. The core library parses numeric strings, applies locale-specific delimiters and abbreviations, and outputs formatted strings. It also supports arithmetic operations with floating-point correction. The library is distributed as a single-file UMD module and has no external runtime dependencies. It is widely used in web applications for displaying numbers in a human-readable, locale-aware manner.

RATING7.3/10
QUALITY8.0/10
MAINTENANCEstale
DRIFThigh
CONTRIBUTORS59
VELOCITY0.29
OPEN ISSUES345
CLOSED ISSUES191
LAST COMMIT8 months ago
chai (npm) ^3.5.0
grunt (npm) latest
grunt-contrib-copy (npm) ^1.0.0
grunt-contrib-jshint (npm) latest
grunt-contrib-nodeunit (npm) 1.0.0
grunt-contrib-uglify (npm) latest
grunt-karma (npm) ^2.0.0
grunt-mocha-test (npm) ^0.13.2
grunt-saucelabs (npm) *
grunt-string-replace (npm) ^1.3.1
karma (npm) ^1.3.0
karma-chai (npm) ^0.1.0
karma-chrome-launcher (npm) ^2.0.0
karma-firefox-launcher (npm) ^1.0.0
karma-mocha (npm) ^1.3.0
karma-mocha-reporter (npm) ^2.2.1
karma-sauce-launcher (npm) ^1.1.0
load-grunt-tasks (npm) ^3.5.2
mocha (npm) ^3.1.2
uglify-js (npm) latest
Files by Type (count)
JavaScript
161
JSON
3
Git Ignore
1
YAML
1
Other (no ext)
1
Markdown
1
Files by Type (size)
JavaScript
316KB
Markdown
8KB
JSON
1KB
Other (no ext)
1KB
Git Ignore
422B
YAML
125B

The LLM identified 2 files worth highlighting for reuse:

Implements a bytes format plugin that supports both decimal (base 1000) and binary (base 1024) units. It registers itself via numeral.register('format', 'bytes', {...}) and provides format/unformat functions. The format function selects the appropriate unit suffix based on value magnitude, and the unformat function parses strings like '5MB' or '3GiB' back to numbers. This component is self-contained, demonstrates a clean plugin pattern, and can be reused in any project needing byte formatting.

file: src/formats/bytes.js ↗ | tags: #plugin-architecture #format-registration

Implements a percentage format plugin that scales values by 100 (configurable via numeral.options.scalePercentBy100). It registers itself via numeral.register('format', 'percentage', {...}) and handles formatting with optional space before '%' and correct placement when parentheses are used for negatives. The unformat function reverses the scaling. This component is isolated, demonstrates a common formatting pattern, and can be extracted for use in other projects requiring percentage display.

file: src/formats/percentage.js ↗ | tags: #plugin-architecture #format-registration
Last analyzed: 2026-08-25 03:07:54.595944
Next check: 2026-11-23 03:07:54.592869
$ submit: