1 Star 1 Fork 0

小瑞 / nupp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

nupp

一款由 typescript 编写的 数字转(汉字/大写)的 js 工具库

安装

npm

npm i nupp -s

pnpm

pnpm i nupp -s

yarn

yarn add nupp

仓库地址

npm 地址

使用案例

可点击 此处 中的 example/src/main.js 进行查看

Option

属性

属性名 类型 描述 默认值
type sumcapitalcharacter 类型。sum: 金额,若 存在连续多个 0 ,将被忽略,如:1001 -> 一零一,注:若 传递的浮点数长度超过 2 位,将被忽略并不会返回超过的内容;capital: 大写数字,若 传入数值为 浮点数(3.14) ,整数部分和小数部分将以 ',' 分割; character: 汉字,若 传入数值为 浮点数(3.14) ,整数部分和小数部分将以 ',' 分割。 character
unit boolean 当为 true 时将携带单位;仅 type = sum 时有效,若传递的 数据为 浮点数 将携带 角、分单位 true
sumCapital boolean 开启大写转换,仅 type = sum 时有效。sumCapital = true 金额将会转成 大写汉字;sumCapital = false 金额将会转成 汉字,不会进行大写转换 true
maxNumber number 最大限制 999999999999
minNumber number 最小限制 0

浏览器支持情况

chrome edge firefox opera safari
53+ 79+ 63+ 40+ 10+
MIT License Copyright (c) 2023 Xiao Rui Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一款由 typescript 编写的 数字转(汉字/大写)的 js 工具库 展开 收起
TypeScript 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/xiaorui-23/nupp.git
git@gitee.com:xiaorui-23/nupp.git
xiaorui-23
nupp
nupp
master

搜索帮助