diff options
| author | Eric Paris <[email protected]> | 2016-09-15 11:31:01 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-09-15 11:31:01 -0400 |
| commit | c7e63cf4530bcd3ba943729cee0efeff2ebea63f (patch) | |
| tree | 49309d3c76fea4ccdc96e849bf1bed1d834a1bf1 /float64.go | |
| parent | 7b17cc4658ef5ca157b986ea5c0b43af7938532b (diff) | |
| parent | d16d05ecad8d146ef127c975e2e3e167b6e38ad6 (diff) | |
Merge pull request #93 from bogem/flagStrings
Use strconv instead of fmt in some values' String funcs
Diffstat (limited to 'float64.go')
| -rw-r--r-- | float64.go | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1,9 +1,6 @@ package pflag -import ( - "fmt" - "strconv" -) +import "strconv" // -- float64 Value type float64Value float64 @@ -23,7 +20,7 @@ func (f *float64Value) Type() string { return "float64" } -func (f *float64Value) String() string { return fmt.Sprintf("%v", *f) } +func (f *float64Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 64) } func float64Conv(sval string) (interface{}, error) { return strconv.ParseFloat(sval, 64) |
