alpacadecimal
alpacadecimal copied to clipboard
Faster way to convert decimal.Decimal to alpacadecimal.Decimal
sometimes, we have external API that returns decimal.Decimal
, and we need to convert these instances to alpacadecimal.Decimal
.
currently, we can do this converson via "string" (decimal.Decimal -> string -> alpacadecimal.Decimal).
but there might be more efficient way to do this via: (decimal.Decimal -> decimal.Exponent() + decimal.Coefficient() / decimal.CoefficientInt64() -> alpacadecimal.NewFromBigInt
^ requires benchmarks