diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-10 06:47:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-10 06:47:58 +0100 |
| commit | 20361bd2bfe1dfc1e13a2253ef0a76134a25ebe2 (patch) | |
| tree | bc9495c5c2c8c1bdbd7c36a4ceef93ecce338448 /src/liballoc | |
| parent | 6f1db996c19c8eed59554b83be3ca9863cef0690 (diff) | |
| parent | 7c60405dd63a2d5720251c97ec209d8844f56395 (diff) | |
| download | rust-20361bd2bfe1dfc1e13a2253ef0a76134a25ebe2.tar.gz rust-20361bd2bfe1dfc1e13a2253ef0a76134a25ebe2.zip | |
Rollup merge of #69861 - Dylnuge:dylnuge/locale-doc, r=Mark-Simulacrum
Add note about localization to std::fmt docs Closes #69681
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/fmt.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/liballoc/fmt.rs b/src/liballoc/fmt.rs index e6162e0f571..13ef2f063f9 100644 --- a/src/liballoc/fmt.rs +++ b/src/liballoc/fmt.rs @@ -247,6 +247,21 @@ //! Hello, ` 123` has 3 right-aligned characters //! ``` //! +//! ## Localization +//! +//! In some programming languages, the behavior of string formatting functions +//! depends on the operating system's locale setting. The format functions +//! provided by Rust's standard library do not have any concept of locale, and +//! will produce the same results on all systems regardless of user +//! configuration. +//! +//! For example, the following code will always print `1.5` even if the system +//! locale uses a decimal separator other than a dot. +//! +//! ``` +//! println!("The value is {}", 1.5); +//! ``` +//! //! # Escaping //! //! The literal characters `{` and `}` may be included in a string by preceding |
