Int and String F#
20,528
Empty string ""
isn't compatible with x
which is of int
type. You can use
let int2String x = sprintf "%i" x
or
let int2String (x: int) = string x
Author by
user1090614
Updated on July 05, 2022Comments
-
user1090614 almost 2 years
I have a function in F#, where I take an
int
value and return theint
as astring
.let inttostring (x:int):string = ""+x
I can't get ToString to work. Any help would be appreciated.