expression
String precision and Unicode display width
String precision limits Unicode scalar values in the standard string formatter, not bytes or grapheme clusters. Terminal columns can differ from scalar counts. Expected stdout (not executed): سل Common mistake: Using string precision for grapheme-safe or terminal-column truncation.
Formal Syntax & Structure
rust syntaxrust
{:.n}Working Example
Example Snippetrust
fn main() { let word="سلام"; println!("{word:.2}");}