I have an integer which I want to convert to a string with leading zeros.
So I have 1
and want to turn it into 01
. 14
should turn into 14
not 014
.
I tried:
let str = (string 1).PadLeft(2, '0') // visual studio suggested this one
let str = (string 1).PadLeft 2 '0'
let str = String.PadLeft 2 '0' (string 1)
But neither work :(
When I search for something like this with F# I get stuff with printfn
but I don't want to print to stdout :/
Disclaimer: This is my first F#