Skip to content

tkachenkosi/go-decimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#Go-Decimal

The go-decimal package providers a Decimal type for multi-precision arithmetic.

##Usage

  • create a Decimal instance by float64 or int64:

      dec := decimal.New(5.18)
    
      dec := new(decimal.Decimal).SetFloat(5.18)
    
      dec := new(decimal.Decimal).SetInt(5)
    
  • create a Decimal instance by string:

      dec, err := decimal.Parse("5.18181818181818181818181818181818181818")
      
      dec, err := new(decimal.Decimal).SetString("5.18181818181818181818181818181818181818")
    

About

A decimal package for golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages