F # sprintf will not print in interactive console

I am trying to print an int using the F # interactive console.

let x = sprintf "%d", 3 printf x 

gives:

stdin (12.8): error FS0001: type '(int β†’ string) * System.Numerics.BigIntege r' incompatible with type 'Printf.TextWriterFormat <' a> '

What am I doing wrong?

+4
source share
1 answer

to try

 let x = sprintf "%d" 3 printf "%s" x 

since the way you wrote x is a set of functions and a number

+7
source

Source: https://habr.com/ru/post/1402922/


All Articles