[go-nuts] unexpected strconv.FormatFloat behaviour

2017-07-01 Thread Dan Kortschak
Is this expected: ``` package main import ( "fmt" "strconv" ) func main() { fmt.Print(strconv.FormatFloat(0.5, 'f', 0, 64)) } ``` ``` 0 ``` https://play.golang.org/p/HEyxpGPrX3 This is truncating, not rounding. -- You received this message because you are subscribed

Re: [go-nuts] unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Rémy Oudompheng
2017-07-02 6:20 GMT+02:00 Dan Kortschak : > Is this expected: > > ``` > package main > > import ( > "fmt" > "strconv" > ) > > func main() { > fmt.Print(strconv.FormatFloat(0.5, 'f', 0, 64)) > } > ``` > > ``` > 0 > ``` > > https://play.golang.org/p/HEyxpGPrX3 > > This is trun

Re: [go-nuts] unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Dan Kortschak
Thanks Rémy. Welcome back. On Sun, 2017-07-02 at 09:04 +0200, Rémy Oudompheng wrote: > 2017-07-02 6:20 GMT+02:00 Dan Kortschak u>: > > > > Is this expected: > > > > ``` > > package main > > > > import ( > > "fmt" > > "strconv" > > ) > > > > func main() { > > fmt.Print