package
0.0.7
Repository: https://github.com/x-module/helper.git
Documentation: pkg.go.dev

# README

格式化器包含一些数据格式化处理方法。

import "github.com/x-module/helper/formatter"

函数列表:

  • CommaNumber : 用逗号每隔 3 位分割数字/字符串,支持前缀添加符号。
  • FormatSize : 格式化显示大小。

# Functions

CommaNumber 从右开始每隔3个数字加上逗号。前面加符号char。 如果value是无效的数字字符串,例如"aa",则返回空字符串 Comma("12345", "$") => "$12,345", Comma(12345, "$") => "$12,345".
FormatSize 格式化显示大小.