From e7294ced57d588cd19693ab67860317cd3dbbe95 Mon Sep 17 00:00:00 2001 From: Ivan Startsev Date: Mon, 7 Oct 2024 09:52:25 +0300 Subject: [PATCH] Fix case with Infinity. `exp` value in decode always must be zero, otherwise String method adds extra trailing zeroes to the string. --- v2/number.go | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/number.go b/v2/number.go index a52e2a6..b586a78 100644 --- a/v2/number.go +++ b/v2/number.go @@ -180,6 +180,7 @@ func (num *Number) decode() (strNum string, exp int, negative bool, err error) { if _isPosInf(num.data) || _isNegInf(num.data) { strNum = "Infinity" + exp = 0 return }