ruble

package module
v0.0.0-...-89a44a2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 9 Imported by: 0

README

ruble

Official rates of russian ruble for a specific date.

curs, err := GetCurrenciesByCode(time.Now())

// How many rubles in 100 USD?
fmt.Printf("A hundred bucks = %.2f rubles\n", 100*curs["USD"])

Documentation

Overview

Official rates of russian ruble for a specific date http://www.cbr.ru/scripts/Root.asp?PrtId=SXML

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrenciesByCode

func CurrenciesByCode(curs []Currency) map[string]float64

func GetCurrenciesByCode

func GetCurrenciesByCode(date time.Time) (map[string]float64, error)

func Round

func Round(x float64) float64

func RoundPlus

func RoundPlus(x float64, places int) float64

Types

type Currency

type Currency struct {
	Code    string  `xml:"CharCode"`
	Nominal int     `xml:"Nominal"`
	Name    string  `xml:"Name"`
	Value   float64 `xml:"Value"`
}

func GetCurrencies

func GetCurrencies(date time.Time) ([]Currency, error)

Jump to

Keyboard shortcuts

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