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

Function format_number

crates/opencode-tui/src/components/sidebar.rs:648–658  ·  view source on GitHub ↗
(value: u64)

Source from the content-addressed store, hash-verified

646}
647
648fn format_number(value: u64) -> String {
649 let digits = value.to_string();
650 let mut out = String::with_capacity(digits.len() + (digits.len() / 3));
651 for (idx, ch) in digits.chars().rev().enumerate() {
652 if idx > 0 && idx % 3 == 0 {
653 out.push(',');
654 }
655 out.push(ch);
656 }
657 out.chars().rev().collect()
658}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected