LiveNumberFormat.js
A tiny Javascript library that allows for real time formatting of numbers & currencies, ~1600 bytes minified + gzipped.
Install / Use
/learn @abhinavxd/LiveNumberFormat.jsREADME
liveNumberFormat.js
A tiny Javascript library that gives live as-you-type formatting to numbers & currencies, ~1600 bytes minified + gzipped.
Check the demo source.
Usage
npm i live-number-format
Default values for config shown below.
<input type="text"/>
let input = document.querySelector("input");
new LiveNumberFormat(input,
{
// Options for formatStyle
// 1. thousandLakhCrore
// 2. thousand
// 3. tenThousand
formatStyle: "thousand",
stripLeadingZeroes: false,
allowNegative: true,
// Max integer digits allowed.
// defaults to Infinity
integerScale: 20,
// Max decimals digits allowed.
// defaults to Infinity
decimalScale: 7
});
Attribution
Regex forked from cleave-zen with improved cursor positioning with fixes and smaller bundle size.
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
