MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_separator_interval

Method get_separator_interval

crates/common/src/format.rs:440–454  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

438 }
439
440 const fn get_separator_interval(&self) -> usize {
441 match self.format_type {
442 Some(FormatType::Binary | FormatType::Octal | FormatType::Hex(_)) => 4,
443 Some(
444 FormatType::Decimal
445 | FormatType::FixedPoint(_)
446 | FormatType::GeneralFormat(_)
447 | FormatType::Exponent(_)
448 | FormatType::Percentage
449 | FormatType::Number(_),
450 ) => 3,
451 None => 3,
452 _ => panic!("Separators only valid for numbers!"),
453 }
454 }
455
456 fn add_magnitude_separators(&self, magnitude_str: String, prefix: &str) -> String {
457 match &self.grouping_option {

Callers 2

format_complex_floatMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected