Skip to content
/ percent Public
forked from dariubs/percent

Simple library for calculate percentages in Go.

License

Notifications You must be signed in to change notification settings

negah/percent

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

percent.go

Build Status GoDoc Go Report Card

Calculate percentage in Golang.

Install

go get github.com/negah/percent

Usage

/*
* Calculate what is [percent]% of [number]
*/
percent.Percent(25, 2000) // return 500

/*
* Calculate [number1] is what percent of [number2]
*/
percent.PercentOf(300, 2400) // return 12.5

/*
* Calculate what is the percentage increase/decrease from [number1] to [number2]
*/
percent.Change(20, 60) // return 200

Documentation

GoDoc

License

MIT

Author

Dariush Abbasi (@dariubs )

About

Simple library for calculate percentages in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%