From 76a1319387028c3389f10fdb7079aca1d19190ad Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 31 May 2017 14:12:36 +0200 Subject: Set bignumber config --- src/bignumber_config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/bignumber_config.ts (limited to 'src/bignumber_config.ts') diff --git a/src/bignumber_config.ts b/src/bignumber_config.ts new file mode 100644 index 000000000..9641159d0 --- /dev/null +++ b/src/bignumber_config.ts @@ -0,0 +1,9 @@ +import * as BigNumber from 'bignumber.js'; + +export function setBigNumberConfig() { + // 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({ + EXPONENTIAL_AT: 1000, + }); +} -- cgit v1.2.3 From 1fe1675726c965b70b118a0f04ad1ddd661ee32e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 1 Jun 2017 14:11:25 +0200 Subject: make bigNumberConfig a module --- src/bignumber_config.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/bignumber_config.ts') diff --git a/src/bignumber_config.ts b/src/bignumber_config.ts index 9641159d0..9c1715f86 100644 --- a/src/bignumber_config.ts +++ b/src/bignumber_config.ts @@ -1,9 +1,11 @@ import * as BigNumber from 'bignumber.js'; -export function setBigNumberConfig() { - // 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({ - EXPONENTIAL_AT: 1000, - }); -} +export const bigNumberConfigs = { + configure() { + // 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({ + EXPONENTIAL_AT: 1000, + }); + }, +}; -- cgit v1.2.3