Skip to content

Commit 20361bd

Browse files
authored
Rollup merge of #69861 - Dylnuge:dylnuge/locale-doc, r=Mark-Simulacrum
Add note about localization to std::fmt docs Closes #69681
2 parents 6f1db99 + 7c60405 commit 20361bd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/liballoc/fmt.rs

+15
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,21 @@
247247
//! Hello, ` 123` has 3 right-aligned characters
248248
//! ```
249249
//!
250+
//! ## Localization
251+
//!
252+
//! In some programming languages, the behavior of string formatting functions
253+
//! depends on the operating system's locale setting. The format functions
254+
//! provided by Rust's standard library do not have any concept of locale, and
255+
//! will produce the same results on all systems regardless of user
256+
//! configuration.
257+
//!
258+
//! For example, the following code will always print `1.5` even if the system
259+
//! locale uses a decimal separator other than a dot.
260+
//!
261+
//! ```
262+
//! println!("The value is {}", 1.5);
263+
//! ```
264+
//!
250265
//! # Escaping
251266
//!
252267
//! The literal characters `{` and `}` may be included in a string by preceding

0 commit comments

Comments
 (0)