Skip to content
/ amount Public

A go package that converts financial amount to words. Catering to indian style i.e lakh and crore instead of millions.

License

Notifications You must be signed in to change notification settings

jethi/amount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

amount

amount is a simple go package that converts financial amount to words. Catering to indian style i.e lakh and crore instead of millions or billions.

Installation

go get github.com/jethi/amount

Use

Simply use the ToWords function after installing and importing.

Import:

import "github.com/jethi/amount"

ToWords

ToWords accept a uint and returns corresponding amount in words.

amount.ToWords(uint) string

Example

package main

import (
	"fmt"
	"github.com/jethi/amount"
)

func main() {
	var myNum uint
	var ans string
	
	myNum = 561085
	ans = amount.ToWords(myNum)
	fmt.Println(ans)
}

Output:

Five Lakh Sixty One Thousand Eighty Five

About

A go package that converts financial amount to words. Catering to indian style i.e lakh and crore instead of millions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages