1.5.5 • Published 2 years ago
the-math v1.5.5
TheMath
Lib with function to execute operations arithmetics, and you can resolve string operation with resolve.
Installation
You can install with npm:
npm install the-math
You can install with yarn:
yarn add the-math
Features
- chain - Solve a chain of complex operations.
- subtract - Solve subtraction between 2 numbers.
- Sum - Solve sum between 2 numbers.
- divide - Solve division between 2 numbers.
- multiply - Solve multiplication between 2 numbers.
- resolve - Solve a string operation arithmetic.
Exemples
1. Solve a chain of complex operations.
import TheMath from 'the-math';
const chain = TheMath.createChain({
round: {
type: 'floor',
precision: 2
}
});
const result = chain(4.91231).plus(2.12413).done();
// result: 7.03
2. Solve subtraction between 2 numbers.
import TheMath from 'the-math';
const result = TheMath.subtract(10, 3);
// result: 7
3. Solve sum between 2 numbers.
import TheMath from 'the-math';
const result = TheMath.sum(14, 7);
// result: 21
4. Solve division between 2 numbers.
import TheMath from 'the-math';
const result = TheMath.divide(21, 3);
// result: 7
5. Solve multiplication between 2 numbers.
import TheMath from 'the-math';
const result = TheMath.multiply(6, 3);
// result: 18
6. Solve a string operation arithmetic.
import TheMath from 'the-math';
const result = TheMath.resolve('12+4*3*9/2+1');
// result: 67
Contributors
@allyfx |
---|
Author
@TheMarkWill |
---|
1.5.5
2 years ago
1.5.4
3 years ago
1.5.3
3 years ago
1.5.2
3 years ago
1.4.3
3 years ago
1.3.4
3 years ago
1.4.2
3 years ago
1.3.3
3 years ago
1.4.1
3 years ago
1.3.2
3 years ago
1.4.0
3 years ago
1.2.4
4 years ago
1.2.3
4 years ago
1.3.1
3 years ago
1.2.2
4 years ago
1.3.0
3 years ago
1.2.1
4 years ago
1.2.0
4 years ago
1.1.9
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago