File tree 1 file changed +0
-17
lines changed
1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change 80
80
//! arguments which have names. Like with positional parameters, it is not
81
81
//! valid to provide named parameters that are unused by the format string.
82
82
//!
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
- //!
100
83
//! # Formatting Parameters
101
84
//!
102
85
//! Each argument being formatted can be transformed by a number of formatting
You can’t perform that action at this time.
0 commit comments