From e435fa271badade4c9c831923d16828868f44a37 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Sat, 10 Dec 2022 21:03:16 +0800 Subject: [PATCH] doc: update doc for Comma --- docs/formatter.md | 5 ++--- docs/formatter_zh-CN.md | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) 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 ``` 例子: