From f2e0ab591229c42996e63e727fb5234f3800b2c7 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 21 Mar 2022 14:42:18 +0200 Subject: [PATCH] docs: add formatting example for `"[${10.0000:.2f}]"` --- doc/docs.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/docs.md b/doc/docs.md index 94133b2a7d..3629d8ff8f 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -624,6 +624,9 @@ println('[${int(x):010}]') // pad with zeros on the left => [0000000123] println('[${int(x):b}]') // output as binary => [1111011] println('[${int(x):o}]') // output as octal => [173] println('[${int(x):X}]') // output as uppercase hex => [7B] + +println('[${10.0000:.2}]') // remove insignificant 0s at the end => [10] +println('[${10.0000:.2f}]') // do show the 0s at the end, even though they do not change the number => [10.00] ``` ### String operators