MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / group_size

Function group_size

compiler/src/modules/vm/handlers/format.rs:304–306  ·  view source on GitHub ↗

'_' groups binary/octal/hex every four digits; decimal and ',' every three.

(ty: u8, sep: u8)

Source from the content-addressed store, hash-verified

302
303// '_' groups binary/octal/hex every four digits; decimal and ',' every three.
304fn group_size(ty: u8, sep: u8) -> usize {
305 if sep == b'_' && matches!(ty, b'b' | b'o' | b'x' | b'X') { 4 } else { 3 }
306}
307
308fn add_grouped(digits: &str, group: usize, sep: u8) -> String {
309 let mut out = String::with_capacity(digits.len() + digits.len() / group);

Callers 1

format_intFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected