MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / formatThousands

Function formatThousands

commands.go:84–92  ·  view source on GitHub ↗

formatThousands inserts thousands separators into a non-negative int.

(n int)

Source from the content-addressed store, hash-verified

82
83// formatThousands inserts thousands separators into a non-negative int.
84func formatThousands(n int) string {
85 if n < 0 {
86 return "-" + formatThousands(-n)
87 }
88 if n < 1000 {
89 return fmt.Sprintf("%d", n)
90 }
91 return formatThousands(n/1000) + "," + fmt.Sprintf("%03d", n%1000)
92}
93
94// runCommand handles a line that starts with "/". Returns true if handled,
95// false if the line should fall through to the model as a normal message.

Callers 1

cmdTokensFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected