divan / num2words

num2words - Numbers to words converter in Go (Golang)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

num2words

Build Status GoDoc

num2words - Numbers to words converter in Go (Golang)

Usage

First, import package num2words

import github.com/divan/num2words

Convert number

  str := num2words.Convert(17) // outputs "seventeen"
  ...
  str := num2words.Convert(1024) // outputs "one thousand twenty four"
  ...
  str := num2words.Convert(-123) // outputs "minus one hundred twenty three"

Convert number with " and " between number groups:

  str := num2words.ConvertAnd(514) // outputs "five hundred and fourteen"
  ...
  str := num2words.ConvertAnd(123) // outputs "one hundred and twenty three"

About

num2words - Numbers to words converter in Go (Golang)

License:MIT License


Languages

Language:Go 100.0%