docs: use correct link, use secondary example

This commit is contained in:
Tristan F 2024-02-12 20:17:47 -05:00
parent 30f6665953
commit 0f53e720a8
1 changed files with 5 additions and 2 deletions

View File

@ -278,17 +278,20 @@
//! Hello, ` 123` has 3 right-aligned characters //! Hello, ` 123` has 3 right-aligned characters
//! ``` //! ```
//! //!
//! When truncuating these values, Rust uses round-to-even, which may //! When truncating these values, Rust uses [round half-to-even](https://en.wikipedia.org/wiki/Rounding#Rounding_half_to_even),
//! cause concern when formatting for scientific notation. For example, //! which is the default rounding mode in IEEE 754.
//! For example,
//! //!
//! ``` //! ```
//! print!("{0:.1$e}", 12345, 3); //! print!("{0:.1$e}", 12345, 3);
//! print!("{0:.1$e}", 12355, 3);
//! ``` //! ```
//! //!
//! Would return: //! Would return:
//! //!
//! ```text //! ```text
//! 1.234e4 //! 1.234e4
//! 1.236e4
//! ``` //! ```
//! //!
//! ## Localization //! ## Localization