valuta

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MulanPSL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExchangeCountryValuta

func ExchangeCountryValuta(cny float64, code string) (cur float64, country string)

ExchangeCountryValuta 人民办转目标地域货币 cny 人民币数额 code 目标地域编码 如MY 马来西亚 返回 cur 目标币种数量 country 目标币种名称

func ExchangeCountryValutaTo

func ExchangeCountryValutaTo(code string, cur float64) (cny float64, country string)

ExchangeCountryValutaTo 目标地域货币转人民币 cur 目标币种数量 code 目标地域编码 如MY 马来西亚 返回 cny 人民币数额 country 目标币种名称

func ExchangeCurrency

func ExchangeCurrency(cny float64, code string) (cur float64, country string)

ExchangeCurrency 人民币转其他币种 cny 人民币数额 code 目标币种 编码 返回 cur 目标币种数量 country 目标币种名称

func ExchangeCurrencyStrTo added in v0.0.3

func ExchangeCurrencyStrTo(code, cur string, prec int) (cnyMoney string, country string)

ExchangeCurrencyStrTo 其他币种转人命币 code 币种名称 cur 币种数量 返回 cny 人民币数量 county 固定为CN之类表示中国的符号

func ExchangeCurrencyTo

func ExchangeCurrencyTo(code string, cur float64) (cny float64, country string)

ExchangeCurrencyTo 其他币种转人命币 code 币种名称 cur 币种数量 返回 cny 人民币数量 county 固定为CN之类表示中国的符号

func LoadCountryInfo

func LoadCountryInfo(path string)

LoadCountryInfo 加载国家信息

func ResetCache

func ResetCache()

ResetCache 主动刷新缓存

Types

type CountryCurrency

type CountryCurrency struct {
	ZhCountry      string  `json:"zh_country"`
	Code2          string  `json:"code2"`
	CurrencyCode   string  `json:"currency_code"`
	ZhCurrencyName string  `json:"zh_currency_name"`
	Rate           float64 `json:"rate"`
}

func GetCountryExchangeRate

func GetCountryExchangeRate(code string) CountryCurrency

GetCountryExchangeRate 获取指定国家 货币与人民币的汇率 参考兑换比例 1元人命币,兑换该国家的货币 汇率 code 该国家编码

type CurrencyRate

type CurrencyRate struct {
	Country string  //目标地域
	Rate    float64 //汇率
}

func GetCurrencyExchangeRate

func GetCurrencyExchangeRate(code string) CurrencyRate

GetCurrencyExchangeRate 获取指定国家 货币与人民币的汇率 参考兑换比例 1元人命币,兑换该国家的货币 汇率 code 该国家货币编码

Jump to

Keyboard shortcuts

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