aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-08-08 04:52:53 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-08-08 04:52:53 +0800
commit0a616ad3b8b87c8142598b535154564cb9276cbe (patch)
tree2069631964815b60dafd7f093cdd47579ec4d129 /packages/utils
parent57a44291233548da9785aec3cde92171342c9eb3 (diff)
parent8199e8794331f555679496d32cb87ad8513c31d1 (diff)
downloaddexon-sol-tools-0a616ad3b8b87c8142598b535154564cb9276cbe.tar
dexon-sol-tools-0a616ad3b8b87c8142598b535154564cb9276cbe.tar.gz
dexon-sol-tools-0a616ad3b8b87c8142598b535154564cb9276cbe.tar.bz2
dexon-sol-tools-0a616ad3b8b87c8142598b535154564cb9276cbe.tar.lz
dexon-sol-tools-0a616ad3b8b87c8142598b535154564cb9276cbe.tar.xz
dexon-sol-tools-0a616ad3b8b87c8142598b535154564cb9276cbe.tar.zst
dexon-sol-tools-0a616ad3b8b87c8142598b535154564cb9276cbe.zip
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/sra/add-sra-package
Diffstat (limited to 'packages/utils')
-rw-r--r--packages/utils/CHANGELOG.json9
-rw-r--r--packages/utils/src/configured_bignumber.ts9
2 files changed, 16 insertions, 2 deletions
diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json
index c5f82d73b..8abfbaf43 100644
--- a/packages/utils/CHANGELOG.json
+++ b/packages/utils/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "1.0.5",
+ "changes": [
+ {
+ "note": "Increased BigNumber decimal precision from 20 to 78",
+ "pr": 807
+ }
+ ]
+ },
+ {
"timestamp": 1532619515,
"version": "1.0.4",
"changes": [
diff --git a/packages/utils/src/configured_bignumber.ts b/packages/utils/src/configured_bignumber.ts
index e44c062c2..2b22b6938 100644
--- a/packages/utils/src/configured_bignumber.ts
+++ b/packages/utils/src/configured_bignumber.ts
@@ -1,9 +1,14 @@
import { BigNumber } from 'bignumber.js';
-// By default BigNumber's `toString` method converts to exponential notation if the value has
-// more then 20 digits. We want to avoid this behavior, so we set EXPONENTIAL_AT to a high number
BigNumber.config({
+ // By default BigNumber's `toString` method converts to exponential notation if the value has
+ // more then 20 digits. We want to avoid this behavior, so we set EXPONENTIAL_AT to a high number
EXPONENTIAL_AT: 1000,
+ // Note(albrow): This is the lowest value for which
+ // `x.div(y).floor() === x.divToInt(y)`
+ // for all values of x and y <= MAX_UINT256, where MAX_UINT256 is the
+ // maximum number represented by the uint256 type in Solidity (2^256-1).
+ DECIMAL_PLACES: 78,
});
export { BigNumber };