diff --git a/book/contents/basic/base-type/numbers.md b/book/contents/basic/base-type/numbers.md index f2877da9..07559796 100644 --- a/book/contents/basic/base-type/numbers.md +++ b/book/contents/basic/base-type/numbers.md @@ -126,8 +126,8 @@ fn main() { 42.0_f32, ]; -// 打印数组中第一个值,其中控制小数位为2位 -println!("{:02}", forty_twos[0]); + // 打印数组中第一个值,并控制小数位为2位 + println!("{:.2}", forty_twos[0]); } ```