diff --git a/docs/formatter.md b/docs/formatter.md index 37dc95b..147a9a5 100644 --- a/docs/formatter.md +++ b/docs/formatter.md @@ -28,13 +28,12 @@ import ( ### Comma -
Add comma to number by every 3 numbers from right. ahead by symbol char. -Param should be number or numberic string.
+Add comma to a number value by every 3 numbers from right to left. ahead by symbol char. if value is a invalid number string like "aa", return empty string.
Signature: ```go -func Comma(v any, symbol string) string +func Comma[T constraints.Float | constraints.Integer | string](value T, symbol string) string ``` Example: diff --git a/docs/formatter_zh-CN.md b/docs/formatter_zh-CN.md index 9e80ff3..1c47b59 100644 --- a/docs/formatter_zh-CN.md +++ b/docs/formatter_zh-CN.md @@ -28,12 +28,12 @@ import ( ### Comma -用逗号每隔3位分割数字/字符串,签名添加符号。参数必须是数字或者可以转为数字的字符串
+用逗号每隔3位分割数字/字符串,支持前缀添加符号。参数value必须是数字或者可以转为数字的字符串, 否则返回空字符串
函数签名: ```go -func Comma(v any, symbol string) string +func Comma[T constraints.Float | constraints.Integer | string](value T, symbol string) string ``` 例子: