Click here if you are English user
chinese-number
是一个用来提供阿拉伯数字与(简体)中文数字之间相互转换的 elisp
包,它提供了以下特性:
- 将阿拉伯数字转换为中文(反向转换暂未实现)。
- 中文数字支持大小写。
chinese-number
现已收录进著名的 Emacs
包仓库 melpa,推荐通过 Emacs
自带的包管理工具来安装它。
另外 chinese-number
托管在 GitHub
上,也可以手工安装它,先使用如下 Git
命令克隆到本地:
git clone https://github.com/zhcosin/chinese-number.git
然后将目录移动到你的 emacs
配置目录:
mv chinese-number ~/.emacs.d/chinese-number
chinese-number
的配置相当简单,把下面代码放置到 .emacs
文件中:
(add-to-list 'load-path "~/.emacs.d/chinese-number")
(require 'chinese-number)
要将阿拉伯数字转换为中文,可以使用如下命令:
chinese-number--convert-arabic-to-chinese
而下面这个命令则可以完成反向的转换(暂未实现)
chinese-number--convert-chinese-to-arabic
如果想要在 elisp
代码中使用这样的数字转换,可以调用如下这两个函数:
chinese-number--convert-arabic-number-to-chinese chinese-number--convert-chinese-number-to-arabic
文档结束处。