How to convert integer to string in Go

1 Answer

0 votes
package main

import (
    "fmt"
    "strconv"
)

func main() {
    num := 8901
    
    str := strconv.FormatInt(int64(num), 10)
    
    fmt.Println(str) 
}

 
 
/*
run:
 
8901
 
*/

 



answered May 4, 2025 by avibootz

Related questions

1 answer 88 views
1 answer 152 views
152 views asked May 18, 2025 by avibootz
1 answer 134 views
1 answer 167 views
1 answer 145 views
145 views asked Apr 27, 2025 by avibootz
...