Update packages/stargate/src/modules/staking/aminomessages.ts

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
This commit is contained in:
keupsonite 2022-11-25 16:46:27 +01:00 committed by Simon Warta
parent 63cfaad9e8
commit cc1e8531d8

View File

@ -32,7 +32,7 @@ interface Description {
export function protoDecimalToJson(decimal: string): string {
const parsed = Decimal.fromAtomics(decimal, 18);
const [whole, fractional] = parsed.toString().split(".");
return `${whole}.${(typeof fractional !== "undefined" ? fractional : "").padEnd(18, "0")}`;
return `${whole}.${(fractional ?? "").padEnd(18, "0")}`;
}
function jsonDecimalToProto(decimal: string): string {