MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / format_tokens

Function format_tokens

crates/opencode-cli/src/main.rs:2947–2955  ·  view source on GitHub ↗
(n: u64)

Source from the content-addressed store, hash-verified

2945}
2946
2947fn format_tokens(n: u64) -> String {
2948 if n >= 1_000_000 {
2949 format!("{:.1}M", n as f64 / 1_000_000.0)
2950 } else if n >= 1_000 {
2951 format!("{:.0}K", n as f64 / 1_000.0)
2952 } else {
2953 n.to_string()
2954 }
2955}
2956
2957async fn handle_session_command(action: SessionCommands) -> anyhow::Result<()> {
2958 let db = Database::new()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected