From 47b09077ec59c11aa98cafdbcdcd554ebb8f8c0a Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 18 Dec 2023 10:51:06 -0800 Subject: [PATCH] cherry pick: 3d27fac5 --- math/int.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/math/int.go b/math/int.go index dc945b13d283..3d90d376ac9b 100644 --- a/math/int.go +++ b/math/int.go @@ -153,6 +153,11 @@ func ZeroInt() Int { return Int{big.NewInt(0)} } // OneInt returns Int value with one func OneInt() Int { return Int{big.NewInt(1)} } +// ToDec converts Int to Dec +func (i Int) ToDec() LegacyDec { + return LegacyNewDecFromInt(i) +} + // Int64 converts Int to int64 // Panics if the value is out of range func (i Int) Int64() int64 {