Kit
Functions

stringifiedNumber

stringifiedNumber(putativeNumber): StringifiedNumber

This helper combines asserting that a string will parse as a Number with coercing it to the StringifiedNumber type. It's best used with untrusted input.

Parameters

ParameterType
putativeNumberstring

Returns

StringifiedNumber

Example

import { stringifiedNumber } from '@solana/rpc-types';
 
const decimalNumberString = stringifiedNumber('-42.1');

On this page