Converting to string in go

Code examples

0
0

Golang strconv, Convert Int to String

Golang program that casts float to int

package main

import "fmt"

func main() {
    size := 1.2
    fmt.Println(size)

    // Convert to an int with a cast.
    i := int(size)
    fmt.Println(i)
}

Output

1.2
1

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................