aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/int_to_string_fill.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown/snippets/int_to_string_fill.md')
-rw-r--r--docs/markdown/snippets/int_to_string_fill.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/markdown/snippets/int_to_string_fill.md b/docs/markdown/snippets/int_to_string_fill.md
new file mode 100644
index 0000000..2b0d250
--- /dev/null
+++ b/docs/markdown/snippets/int_to_string_fill.md
@@ -0,0 +1,20 @@
+## Added 'fill' kwarg to int.to_string()
+
+int.to_string() now accepts a `fill` argument. This allows you to pad the
+string representation of the integer with leading zeroes:
+
+```meson
+n = 4
+message(n.to_string())
+message(n.to_string(length: 3))
+
+n = -4
+message(n.to_string(length: 3))
+```
+
+OUTPUT:
+```meson
+4
+004
+-04
+``` \ No newline at end of file