Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/web3/types/bignumber.d.ts>BigNumber#absoluteValue

Deno / TypeScript to Ethereum Connector
Latest
method BigNumber.prototype.absoluteValue
import { BigNumber } from "https://deno.land/x/web3@v0.11.1/types/bignumber.d.ts";

Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this BigNumber.

The return value is always exact and unrounded.

x = new BigNumber(-0.8)
x.absoluteValue()           // '0.8'