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 🙏

© 2026 – Pkg Stats / Ryan Hefner

numeric-react

v1.0.3

Published

进行数字控制:千位分隔符、整数和小数位数的限制

Readme

Numeric

说明

进行数字控制:千位分隔符、整数和小数位数的限制

安装

npm install numeric-react --save
yarn add numeric-react

使用

import Numeric from "numeric-react"  

<Numeric />

API

props

| 属性 | 说明 | 类型 | 默认值 | |------|------|------|-------| | value | 初始值 | number | null | | allowDecimalPadding | 允许用0来填充小数,如果设置为"floats",填充只在有一些小数时才执行 | [bool, "floats"] | true | | decimalPlaces | 格式化值上显示的小数位数,并将其作为原始值的精度 | number | 2 | | digitGroupSeparator | 整数部分是否显示千位分隔符 | [",", ""] | "," | | formatOnPageLoad | 初始化时是否格式化默认值 | bool | true | | historySize | 在内存中保留多少撤销状态(不建议数字过大) | number | 20 | | isCancellable | 用户在使用Esc键时是否可以取消对元素值所做的最后一次修改 | bool | true | | leadingZero | 控制最前面的"0"输入时和失焦时的显示方式 | ["allow", "deny", "keep"] | "deny" | | maximumValue | 可输入的最大值 | string | "10000000000000" | | minimumValue | 可输入的最小值 | string | "-10000000000000" | | modifyValueOnWheel | 元素值是否可以用鼠标滚轮递增/递减,使用鼠标滚轮时可以使用Shift键暂时禁止此功能 | bool | true | | overrideMinMaxLimits | 覆盖最小值和最大值的限制 | ["ceiling", "floor", "ignore"] | null | | readOnly | 是否设置为只读初始化时 | bool | false | | saveValueToSessionStorage | 是否允许将聚焦时的值保存在Session Storage中 | bool | false | | selectOnFocus | 聚焦时值是否被选中 | bool | false | | showOnlyNumbersOnFocus | 聚焦时是否显示千位分隔符 | bool | true | | showPositiveSign | 正数时是否显示"+" | bool | false | | unformatOnHover | 当按住Alt键将鼠标悬停在元素值上时,元素值是否应该未格式化 | bool | true | | unformatOnSubmit | 提交时元素值是否应该未格式化 | bool | false | | wheelOn | 配合modifyValueOnWheel选项,在聚焦或悬停时,元素值可以用鼠标滚轮递增/递减 | ["focus", "hover"] | "focus" | | wheelStep | 配合modifyValueOnWheel选项,允许定义一个固定的步骤,或基于当前值大小计算的渐进式 | [number, "progressive"] | "progressive" | | style | 设置输入框样式 | object | null |

methods

| 方法 | 说明 | 类型 | |------|------|------| | onChange | 输入框内容变化时的回调 | function(e, value) |

参考文档链接