I am using Angular 8 and math.js library for big number manipulation.
I just have an updated version of math.js from 5.4.0 to 6.2.3.
I am using math.js in my component in this way:
import * as mathjs from 'mathjs';
constructor() {
mathjs.config({ number: 'BigNumber', precision: 128 });
}
Suddenly new error appears after the update.
Error: The global config is readonly. Please create a mathjs instance if you want to change the default configuration. Example:
import { create, all } from 'mathjs';
const mathjs = create(all);mathjs.config({ number: 'BigNumber' });
I tried import { create, all } from 'mathjs
, but those methods do not exist at all.
What is the workaround for this problem?