brydavis / fin

Finance for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fin

Finance for Go.


Simple and Compound Interest

package main

import (
	"fmt"
	"github.com/brydavis/fin"
)

func main() {
	p := 1000.0 // principle
	r := 0.05   // interest rate
	y := 35     // years
	v := fin.Compound(p, r, y)

	fmt.Printf("original principle: $%0.2f\tbalance @ %d years: $%0.2f\n", p, y, v) // 5516.015368
}

About

Finance for Go


Languages

Language:Go 70.0%Language:Python 30.0%