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 95 views
1 answer 164 views
164 views asked May 18, 2025 by avibootz
1 answer 148 views
1 answer 185 views
1 answer 162 views
162 views asked Apr 27, 2025 by avibootz
...