Skip to content

Commit

Permalink
feat: strconv/strconvutil: add Ftoa()
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Feb 4, 2024
1 parent 27ab72d commit cc81c2c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion strconv/strconvutil/strconvutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@ func FormatDecimal[N constraints.Float | constraints.Integer](v N, precision int
return fmt.Sprintf(`%.`+strconv.Itoa(precision)+`f`, float64(v))
}

func FormatFloat64Simple(v float64) string {
func Ftoa(v float64) string {
return strconv.FormatFloat(v, 'f', -1, 64)
}

func FormatFloat64Simple(v float64) string {
return Ftoa(v)
}

func FormatFloat64ToIntStringFunnel(v float64) string {
return FormatFloat64ToAnyStringFunnel(v, `%0.0f%%`)
}
Expand Down

0 comments on commit cc81c2c

Please sign in to comment.