【文件属性】:
文件名称:num2words:Golang软件包,用于将数字转换为单词
文件大小:6KB
文件格式:ZIP
更新时间:2021-02-14 14:44:49
Go
字数
Golang软件包将数字转换成单词。 例如: 148变成one hundred forty-eight 。 受此python库启发。
安装
运行go get -u github.com/vinbyte/num2words
用法
package main
import (
"fmt"
"github/vinbyte/num2words"
)
func main() {
n2w := num2words.New("en")
res := n2w.NumberToWord(349)
fmt.Println(res)
}
//output : three hundred forty-nine
测试
运行go test -v
【文件预览】:
num2words-main
----en.go(2KB)
----.gitignore(12B)
----go.mod(85B)
----en_test.go(1KB)
----utils.go(211B)
----num2words_test.go(443B)
----LICENSE(1KB)
----num2words.go(838B)
----go.sum(1024B)
----README.md(503B)
----example()
--------main.go(153B)
----utils_test.go(207B)
----.circleci()
--------config.yml(597B)