mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Update packages/stargate/src/modules/staking/aminomessages.ts
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
This commit is contained in:
parent
63cfaad9e8
commit
cc1e8531d8
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user