Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.18 KB

rounding.md

File metadata and controls

43 lines (28 loc) · 1.18 KB

The scenatios we want to solve for

1) Defactor

const number1 = 2210000000000000000000000000; const number2 = .000000000000000000221; const number3 = 221000000000000000000000000.00000000000000000022;

with decimals as 18, 12, and 6

2) Factor

const number1 = 2210000000000000000000000000; const number2 = .000000000000000000221; const number3 = 221000000000000000000000000.00000000000000000022;

with decimals as 18, 12, and 6

3) Difference of two numbers

const number1 = 2210000000000000000000000000; const number1_1 = 1210000000000000000000000000;

const number2 = .000000000000000000221; const number2_1 = .000000000000000000121;

const number3 = 221000000000000000000000000.00000000000000000022; const number3_1 = 121000000000000000000000000.00000000000000000012;

4) Addition of two numbers

const number1 = 2210000000000000000000000000; const number1_1 = 1210000000000000000000000000;

const number2 = .000000000000000000221; const number2_1 = .000000000000000000121;

const number3 = 221000000000000000000000000.00000000000000000022; const number3_1 = 121000000000000000000000000.00000000000000000012;

Find solutions

Using ether.js

Using pure javascript(new BigInt, BigNumber) etc