Function rutilities::format_rut[][src]

pub fn format_rut(rut: &str) -> String
Expand description

Format a rut with dots every 3 characters and a dash before the last one. Useful to show an internal value. This function cleans the rut, no need to have it clean.

use rutilities::format_rut;

fn main() {
  let rut = "123456789";
  let formatted = format_rut(&rut);
  assert_eq!(formatted, "12.345.678-9");
}