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

Function pad_numeric

compiler/src/modules/vm/handlers/format.rs:337–344  ·  view source on GitHub ↗
(s: &Spec, body: &str)

Source from the content-addressed store, hash-verified

335}
336
337fn pad_numeric(s: &Spec, body: &str) -> String {
338 let (neg, mag) = if let Some(rest) = body.strip_prefix('-') { (true, rest) } else { (false, body) };
339 let sign_ch = sign_char(neg, s.sign);
340 let mut left = String::new();
341 if let Some(c) = sign_ch { left.push(c); }
342 left.push_str(mag);
343 pad_aligned(s, &left, sign_ch.map(|_| 1).unwrap_or(0))
344}
345
346fn pad_string(s: &Spec, body: &str) -> String {
347 let len = body.chars().count();

Callers 1

applyFunction · 0.85

Calls 3

sign_charFunction · 0.85
pad_alignedFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected