mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-11 16:22:26 +08:00
doc: add example and update doc for formatter package
This commit is contained in:
18
formatter/formatter_example_test.go
Normal file
18
formatter/formatter_example_test.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package formatter
|
||||
|
||||
import "fmt"
|
||||
|
||||
func ExampleComma() {
|
||||
result1 := Comma("123", "")
|
||||
result2 := Comma("12345", "$")
|
||||
result3 := Comma(1234567, "¥")
|
||||
|
||||
fmt.Println(result1)
|
||||
fmt.Println(result2)
|
||||
fmt.Println(result3)
|
||||
|
||||
// Output:
|
||||
// 123
|
||||
// $12,345
|
||||
// ¥1,234,567
|
||||
}
|
||||
Reference in New Issue
Block a user