aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/int_to_string_fill.md
blob: 2b0d250858f96872fa9b283726e4be2ace7e01e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
```