Skip to content

Commit

Permalink
Novo método: ConvertkeepZeroToFloat64To4Decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-couto committed Jan 12, 2022
1 parent db1b652 commit f056850
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions float.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ func ConvertkeepZeroToFloat64(value KeepZero) float64 {
return s
}

func ConvertkeepZeroToFloat64To4Decimal(value KeepZero) float64 {
s, _ := strconv.ParseFloat(fmt.Sprintf("%.4f", value), 64)
return s
}

/*
ConvertFloat64ToString4Decimal
*/
Expand Down

0 comments on commit f056850

Please sign in to comment.