Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertEURTo(targetCurrency string, value float64) float64
- func ConvertFromTo(fromCurrency, toCurrency string, value float64) float64
- func ConvertToEUR(currency string, value float64) float64
- func FormatNumber(value float64, precision int) string
- func GetRate(currency string) float64
- func IsNumberValid(value float64) bool
- func RefrashIfRequired()
- func RefrashRates()
- type Money
Constants ¶
View Source
const ( RatesSource = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" CacheExpire = time.Hour * 4 )
Variables ¶
Functions ¶
func ConvertEURTo ¶
Convert EUR to a specific currency; Returns 0 if currency doesn't exist
func ConvertFromTo ¶
Convert from a specific currency to a specific currency; Returns (-)infinite or 0 if currency doesn't exist.
func ConvertToEUR ¶
Convert the spcified currency to EUR; Returns (-)infinite float64 if currency doesn't exist,
func IsNumberValid ¶
Check if value is infinite or 0 (float default)
func RefrashIfRequired ¶
func RefrashIfRequired()
func RefrashRates ¶
func RefrashRates()
Types ¶
Click to show internal directories.
Click to hide internal directories.