util

package
v0.0.0-...-e5f04d6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dce    = "DCE"
	Shfe   = "SHFE"
	Czce   = "CZCE"
	Cffex  = "CFFEX"
	Ine    = "INE"
	Gfex   = "GFEX"
	Sge    = "SGE"
	Nymex  = "NYMEX"
	Comex  = "COMEX"
	Cbot   = "CBOT"
	Cme    = "CME"
	Cboe   = "CBOE"
	UsIce  = "US_ICE"
	EurIce = "EUR_ICE"
	Lme    = "LME"
	Hkex   = "HKEX"
	Sgx    = "SGX"
	Tocom  = "TOCOM"
	Bmd    = "BMD"
	Apex   = "APEX"
	Csi    = "CSI"
	Asx    = "ASX"
	Sfe    = "SFE"
	Dgcx   = "DGCX"
	Dme    = "DME"
	IceSg  = "ICE_SG"
	Tfex   = "TFEX"
	Krx    = "KRX"
	Jpx    = "JPX"
	Xeurex = "XEUREX"
	Shse   = "SHSE"
	Szse   = "SZSE"
	Bjse   = "BJSE"
	Neeq   = "NEEQ"
)
View Source
const (
	Future = 1
	Option = 2
)

Variables

This section is empty.

Functions

func AddHost

func AddHost(content, host string) string

AddHost 文章中带图片的需要添加host

func Float64Equal

func Float64Equal(f1, f2 float64, precision int) bool

Float64Equal 判断f1,f2是否相等,precision为小数点位数

func FormatArticle

func FormatArticle(content string, element *colly.HTMLElement) string

func Host

func Host(element *colly.HTMLElement) string

func InvalidFloat

func InvalidFloat(f float64) bool

InvalidFloat 非法浮点数

func ReplaceNBSPinHtml

func ReplaceNBSPinHtml(s string) string

ReplaceNBSPinHtml 将html中转义后的non-breaking space符号,替换为" "字符串保存(管理端插件kindeditor对转以后\u00a0的格式化有bug)

func Round

func Round(f float64, precision int) float64

Round 四舍五入,precision为小数点位数

func Sum

func Sum(data string) int

Sum 取字符串哈希值

Types

This section is empty.

Jump to

Keyboard shortcuts

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