1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

docs: add formatting example for "[${10.0000:.2f}]"

This commit is contained in:
Delyan Angelov 2022-03-21 14:42:18 +02:00
parent 5815ab8d00
commit f2e0ab5912
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -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