SDKs@solio/coreUtilsformatSafeToString

formatSafeToString()

function formatSafeToString(value): string

Safely formats a number to a string, handling very large or very small numbers with exponents.

Parameters

ParameterTypeDescription
valueanyThe value to format.

Returns

string

  • The formatted string.

Example

const num = 1.23e-45;
const formatted = formatSafeToString(num);
console.log(formatted);