the.bay.news

Human Formatting Integer Outputs

The Rust Programming Language Forum
Human Formatting Integer Outputs
I can read in large integer values like 123_457_789 doing: let n1: usize = nums[1].replace('_', "").parse().unwrap(); To print out integer values I currently do this: println!("total twins = {}; last twin = {}|-2", twinscnt, last_twin); But this only prints out numbers like 123456789. Is there a simple way, or a crate, to print out integer values as: 123,456,789 or 123_456_789?

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.