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

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

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

Returns a BigNumber whose value is the value of this BigNumber shifted by n places.

The shift is of the decimal point, i.e. of powers of ten, and is to the left if n is negative or to the right if n is positive.

The return value is always exact and unrounded.

Throws if n is invalid.

x = new BigNumber(1.23)
x.shiftedBy(3)                      // '1230'
x.shiftedBy(-3)                     // '0.00123'

Parameters

n: number

The shift value, integer, -9007199254740991 to 9007199254740991.