money

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package money provides support for converting between currencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertWithRates

func ConvertWithRates(rates map[string]float64, from string, to string, value float64) (float64, error)

Types

type Converter

type Converter struct {
	Rates map[string]float64
}

A Converter is used to convert between currencies using known exchange rates

func NewConverter

func NewConverter(rates map[string]float64) *Converter

func (*Converter) Convert

func (c *Converter) Convert(from string, to string, value float64) (float64, error)

Convert uses Rates on Converter to exchange from one currency to another.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL