gtbox_hashrate

package
v0.1.86 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GTHashRateFormat added in v0.0.44

func GTHashRateFormat(hs *big.Float) string

GTHashRateFormat 哈希显示单位计算公式 以H/s 为单位传入,根据数值不同换算成进制单位MH/s、GH/s等, 默认保留3位小数点 hs Hash算力值

func GTHashRateFormatWithSed added in v0.0.44

func GTHashRateFormatWithSed(hs *big.Float, fSed int) string

GTHashRateFormatWithSed 哈希显示单位计算公式 以H/s 为单位传入,根据数值不同换算成进制单位PH/s、EH/s、ZH/s、YH/s等 hs Hash算力值 fSed 此参数标识保留机位小数点

func HashRateFormat added in v0.1.52

func HashRateFormat(hs *big.Float) string

HashRateFormat 哈希显示单位计算公式 以H/s 为单位传入,根据数值不同换算成进制单位MH/s、GH/s等, 默认保留3位小数点 hs Hash算力值

Types

type GTHashRate added in v0.0.50

type GTHashRate struct {
	Value    string
	UnitStr  string
	UnitFlag HashRateUnitFormat
}

func GTHashRate2Format added in v0.0.50

func GTHashRate2Format(baseHashRate *big.Float, toFormat HashRateUnitFormat, fSed int) *GTHashRate

GTHashRate2Format 强制转换成某一个Hash单位类型 baseHashRate 基础H/s为单位的 HashRate值 toFormat 要转换成的HashRate计量单位类型 fSed 保留小数点后几位 Return[GTHashRate] 返回值

type HashRateUnitFormat added in v0.0.50

type HashRateUnitFormat int64
const (
	HashRateUnitFormatHs  HashRateUnitFormat = iota // H/s 默认值
	HashRateUnitFormatKHs                           // KH/s
	HashRateUnitFormatMHs                           // MH/s
	HashRateUnitFormatGHs                           // GH/s
	HashRateUnitFormatTHs                           // TH/s
	HashRateUnitFormatPHs                           // PH/s
	HashRateUnitFormatEHs                           // EH/s
	HashRateUnitFormatZHs                           // ZH/s
	HashRateUnitFormatYHs                           // YH/s
)

func (HashRateUnitFormat) String added in v0.0.50

func (unitFormat HashRateUnitFormat) String() string

Jump to

Keyboard shortcuts

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