We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55c5ac5 commit 92da4f3Copy full SHA for 92da4f3
internal/stringy/template.go
@@ -4,40 +4,6 @@ import (
4
"fmt"
5
)
6
7
-func Commafy(i interface{}) string {
8
- var n int64
9
- switch i.(type) {
10
- case int:
11
- n = int64(i.(int))
12
- case int64:
13
- n = i.(int64)
14
- case int32:
15
- n = int64(i.(int32))
16
- }
17
- if n > 1000 {
18
- r := n % 1000
19
- n = n / 1000
20
- return fmt.Sprintf("%s,%03d", Commafy(n), r)
21
22
- return fmt.Sprintf("%d", n)
23
-}
24
-
25
-func FloatToPercent(i float64) string {
26
- return fmt.Sprintf("%.0f", i*100.0)
27
28
29
-func PercSuffix(i float64) string {
30
- switch int(i*100) % 10 {
31
- case 1:
32
- return "st"
33
- case 2:
34
- return "nd"
35
- case 3:
36
- return "rd"
37
38
- return "th"
39
40
41
func NanoSecondToHuman(v float64) string {
42
var suffix string
43
switch {
0 commit comments