FAQ
Hi

If someone will be useful https://github.com/takama/ecbrates

package main

import (
     "fmt"
     "log"

     "github.com/takama/ecbrates"
)

func main() {
     r, err := ecbrates.New()
     if err != nil {
         log.Fatal("Error: ", err)
     }

     // Case 1: get dollar rate relative to euro
     fmt.Println("Exchange rate", r.Date, ": EUR 1 -> USD", r.Rate[ecbrates.USD])

     // Case 2: convert of 100 euros to dollars
     fmt.Println(
         "Exchange rate", r.Date,
         ": EUR 100.0 -> USD", r.Convert(100, ecbrates.EUR, ecbrates.USD),
     )
}


thanks

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 3, '14 at 6:01a
activeNov 3, '14 at 6:01a
posts1
users1
websitegolang.org

1 user in discussion

Igor Dolzhikov: 1 post

People

Translate

site design / logo © 2022 Grokbase