From f05685000995b3ed792486ee06212274cb37c1cc Mon Sep 17 00:00:00 2001 From: Armando Couto Date: Wed, 12 Jan 2022 16:48:30 -0300 Subject: [PATCH] =?UTF-8?q?Novo=20m=C3=A9todo:=20ConvertkeepZeroToFloat64T?= =?UTF-8?q?o4Decimal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- float.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/float.go b/float.go index 14f5b2b..d8b091b 100644 --- a/float.go +++ b/float.go @@ -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 */