format

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

*

  • Copyright 2015 @ 56x.net.
  • name : category
  • author : jarryliu
  • date : -- :
  • description :
  • history :

*

  • Copyright 2015 @ 56x.net.
  • name : format
  • author : jarryliu
  • date : 2016-05-23 19:42
  • description :
  • history :

*

  • Copyright 2014 @ 56x.net.
  • name :
  • author : jarryliu
  • date : 2014-02-11 21:15
  • description :
  • history :

*

  • Copyright 2015 @ 56x.net.
  • name : time
  • author : jarryliu
  • date : 2015-11-07 22:52
  • description :
  • history :

Index

Constants

This section is empty.

Variables

View Source
var GlobalFileServerPath = ""

静态文件服务器路径

Functions

func DecimalToString

func DecimalToString(f float64) string

func FixedDecimal

func FixedDecimal(amount float64) float64

精确到2位浮点数

func FixedDecimalN

func FixedDecimalN(amount float64, n int) float64

普通近似值计算, 不四舍五入,n为小数点精度

func FormatFloat

func FormatFloat(f float32) string

func FormatFloat64

func FormatFloat64(f float64) string

func FormatIntMoney

func FormatIntMoney(amount int64) string

FormatIntMoney 格式化int类型的金额为字符串

func GetFileFullUrl added in v0.4.10

func GetFileFullUrl(url string) string

GetFileFullUrl 获取完整的文件地址

func GetGender

func GetGender(gender int32) string

获取性别

func GetGoodsImageUrl

func GetGoodsImageUrl(image string) string

获取商品图片地址

func GetName

func GetName(url string) string

获取URL/路径的名称

func GetNoPicPath

func GetNoPicPath() string

获取无图片地址

func HanDateTime

func HanDateTime(t time.Time) string

func HanUnixDateTime

func HanUnixDateTime(unix int64) string

func I32ArrStrJoin

func I32ArrStrJoin(ids []int32) string

func I64ArrStrJoin

func I64ArrStrJoin(ids []int64) string

func IntArrStrJoin

func IntArrStrJoin(ids []int) string

获取栏目编号字符串

func IntToFloatAmount

func IntToFloatAmount(i int) string

func MaskNickname added in v0.4.10

func MaskNickname(nickname string) string

屏蔽昵称

func RoundAmount

func RoundAmount(amount float32) float32

func ToDiscountStr

func ToDiscountStr(discount int) string

func UnixTimeStr

func UnixTimeStr(unix int64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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