From f9e512c593795c0c2bcccbb446d8ba68ba8cae2f Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Fri, 25 Feb 2022 15:26:51 +0000 Subject: [PATCH] Fix floating points < 1 --- postgres/numeric/numeric.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postgres/numeric/numeric.go b/postgres/numeric/numeric.go index 753feff..73fdb16 100644 --- a/postgres/numeric/numeric.go +++ b/postgres/numeric/numeric.go @@ -129,7 +129,7 @@ func (n Numeric) String() string { exp = -exp for length <= exp { - bytes = append(bytes, byte('0')) + bytes = append([]byte{byte('0')}, bytes...) length++ } @@ -166,7 +166,7 @@ func (n Numeric) MarshalJSON() ([]byte, error) { exp = -exp for length <= exp { - bytes = append(bytes, byte('0')) + bytes = append([]byte{byte('0')}, bytes...) length++ }