https://github.com/k186/number2words
数字转换成中文大写,最大12位整数,小数最多3位
https://github.com/k186/number2words
gulp magic number tool
Last synced: 2 months ago
JSON representation
数字转换成中文大写,最大12位整数,小数最多3位
- Host: GitHub
- URL: https://github.com/k186/number2words
- Owner: k186
- Created: 2016-06-30T08:03:05.000Z (almost 10 years ago)
- Default Branch: gh-pages
- Last Pushed: 2017-03-09T07:34:32.000Z (over 9 years ago)
- Last Synced: 2025-03-06T11:46:57.734Z (over 1 year ago)
- Topics: gulp, magic, number, tool
- Language: JavaScript
- Homepage: https://k186.github.io/number2words/index.html
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##数字转中文大写(javascript)
欢迎提建议谢谢。
###现在状态
最大输入12位整数,小数最多3位
```
壹 亿 贰 仟 叁 佰 肆 拾 伍 万 陆 仟 柒 佰 捌 拾 玖 元 壹 角 贰 分 叁 厘
```
自动判断小数位数,不在做默认设定
使用方法
```
var option={
isTag:true, //false
numTag:'span',//可为空
unitTag:'div'//可为空
};
*.innerHTML= num2word(number,option);调用方法名 及参数
```
传入参数增加输出标签ID
```
现有输出是字符串如果在某些情况下会转义html标签,这是我们不想看到的
····
option={
....
outputID:""
}
num2word(number,option);调用方法名 及参数
```