aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_pastebins/nix-string-padding.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/_pastebins/nix-string-padding.md b/_pastebins/nix-string-padding.md
new file mode 100644
index 0000000..8de9048
--- /dev/null
+++ b/_pastebins/nix-string-padding.md
@@ -0,0 +1,10 @@
+---
+title: Nix string padding
+date: 2018-07-13
+layout: pastebin
+lang: en
+---
+
+```nix
+padString = (n: if n < 10 then "0" + toString n else toString n)
+```