MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / format_tokens

Function format_tokens

atomic-cli/src/commands/agent/attest.rs:776–784  ·  view source on GitHub ↗
(tokens: u64)

Source from the content-addressed store, hash-verified

774}
775
776fn format_tokens(tokens: u64) -> String {
777 if tokens >= 1_000_000 {
778 format!("{:.1}M", tokens as f64 / 1_000_000.0)
779 } else if tokens >= 1_000 {
780 format!("{:.1}k", tokens as f64 / 1_000.0)
781 } else {
782 format!("{}", tokens)
783 }
784}
785
786fn format_cost(usd: f64) -> String {
787 if usd == 0.0 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected