File tree Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change 8080//! arguments which have names. Like with positional parameters, it is not
8181//! valid to provide named parameters that are unused by the format string.
8282//!
83- //! ## Argument types
84- //!
85- //! Each argument's type is dictated by the format string.
86- //! There are various parameters which require a particular type, however.
87- //! An example is the `{:.*}` syntax, which sets the number of decimal places
88- //! in floating-point types:
89- //!
90- //! ```
91- //! let formatted_number = format!("{:.*}", 2, 1.234567);
92- //!
93- //! assert_eq!("1.23", formatted_number)
94- //! ```
95- //!
96- //! If this syntax is used, then the number of characters to print precedes the
97- //! actual object being formatted, and the number of characters must have the
98- //! type [`usize`].
99- //!
10083//! # Formatting Parameters
10184//!
10285//! Each argument being formatted can be transformed by a number of formatting
You can’t perform that action at this time.
0 commit comments