MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / format_number

Function format_number

src/monitor.rs:664–674  ·  view source on GitHub ↗
(n: u64)

Source from the content-addressed store, hash-verified

662}
663
664fn format_number(n: u64) -> String {
665 let s = n.to_string();
666 let mut result = String::with_capacity(s.len() + s.len() / 3);
667 for (i, c) in s.chars().rev().enumerate() {
668 if i > 0 && i % 3 == 0 {
669 result.push(',');
670 }
671 result.push(c);
672 }
673 result.chars().rev().collect()
674}
675
676#[cfg(test)]
677#[allow(clippy::unwrap_used, clippy::expect_used)]

Callers 1

monitor_loopFunction · 0.70

Calls 2

pushMethod · 0.80
collectMethod · 0.80

Tested by

no test coverage detected