mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +00:00
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
|
||||
//! ```
|
||||
//!
|
||||
//! 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
|
||||
//!
|
||||
//! In some programming languages, the behavior of string formatting functions
|
||||
|
Loading…
Reference in New Issue
Block a user