MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / format_number

Function format_number

crates/opencode-tui/src/components/session.rs:1396–1406  ·  view source on GitHub ↗
(value: u64)

Source from the content-addressed store, hash-verified

1394}
1395
1396fn format_number(value: u64) -> String {
1397 let digits = value.to_string();
1398 let mut out = String::with_capacity(digits.len() + (digits.len() / 3));
1399 for (idx, ch) in digits.chars().rev().enumerate() {
1400 if idx > 0 && idx % 3 == 0 {
1401 out.push(',');
1402 }
1403 out.push(ch);
1404 }
1405 out.chars().rev().collect()
1406}

Callers 1

render_headerMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected