Skip to main content

Function: canonicalDecimalString()

GalaChain core SDK 1.0.0-rc.8


GalaChain core SDK 1.0.0-rc.8 / index / canonicalDecimalString

Function: canonicalDecimalString()

canonicalDecimalString(value): string

Defined in: packages/gala-core-sdk/dist/index.d.ts:1685

A quantity in the form GalaChain's IsBigNumber validator accepts: FIXED notation, no leading zeros, no trailing decimal zeros (BigNumber#toFixed(); never toString(), which turns 0.00000001 into 1e-8, and never a JS number in between).

Parameters​

value​

string | number

Returns​

string

Throws​

GalaSDKError (INVALID_DECIMAL) for a value that is not a finite number. The wallet's cleanNumber returned the string 'NaN' there; signing that text can only fail on chain.