docs: mention round-to-even in precision formatting
This commit is contained in:
parent
b17491c8f6
commit
730560b982
@ -278,6 +278,19 @@
|
|||||||
//! 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
|
||||||
|
//! cause concern when formatting for scientific notation. For example,
|
||||||
|
//!
|
||||||
|
//! ```
|
||||||
|
//! print!("{0:.1$e}", 12345, 3);
|
||||||
|
//! ```
|
||||||
|
//!
|
||||||
|
//! Would return:
|
||||||
|
//!
|
||||||
|
//! ```text
|
||||||
|
//! 1.234e4
|
||||||
|
//! ```
|
||||||
|
//!
|
||||||
//! ## Localization
|
//! ## Localization
|
||||||
//!
|
//!
|
||||||
//! In some programming languages, the behavior of string formatting functions
|
//! In some programming languages, the behavior of string formatting functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user