English | 简体中文
| Area | Support |
|---|---|
| Purpose | Small decimal calculator for precise string-based arithmetic. |
| Package | @rc-component/mini-decimal |
| Release | @rc-component/np / rc-np |
npm install @rc-component/mini-decimalimport getMiniDecimal from '@rc-component/mini-decimal';
getMiniDecimal('0.1').add('0.2').toString(); // 0.3
getMiniDecimal('0.1').multi('0.2').toString(); // 0.02| Method | Description |
|---|---|
add(value) |
Add another decimal value. |
multi(value) |
Multiply by another decimal value. |
negate() |
Return the negated value. |
equal(value) |
Check equality. |
lessEquals(value) |
Check whether the current value is less than or equal to another decimal value. |
npm install
npm test
npm run lint
npm run tsc
npm run compileThe dumi site runs at http://localhost:8000.
npm run prepublishOnlyThe release flow is handled by @rc-component/np through the rc-np command when the package uses the shared release flow.
@rc-component/mini-decimal is released under the MIT license.