# @rc-component/mini-decimal

> Lite lib to only support decimal add calculation

Latest version **1.1.4** (published 2026-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rc-component/mini-decimal
pnpm add @rc-component/mini-decimal
yarn add @rc-component/mini-decimal
bun add @rc-component/mini-decimal
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2026-06-05 |
| First published | 2022-12-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.x |
| Dependencies | 1 |
| Unpacked size | 48.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | smith3816@gmail.com |
| Maintainers | zombiej, afc163, madccc, peachscript, chenshuai2144 |
| Keywords | decimal |

## Links

- npm: https://www.npmjs.com/package/@rc-component/mini-decimal
- Repository: https://github.com/react-component/mini-decimal
- Issues: https://github.com/react-component/mini-decimal/issues
- npm.io page: https://npm.io/package/@rc-component/mini-decimal

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.18.0

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2026-06-05
- 1.1.3 — 2026-03-17
- 1.1.2 — 2026-03-14
- 1.1.1 — 2026-03-13
- 1.1.0 — 2023-06-12
- 1.0.1 — 2022-12-01
- 1.0.0 — 2022-12-01

## README

# @rc-component/mini-decimal

A mini decimal calculator which only support `add`, `multi` or compare operation for mini bundle size.

[![NPM version][npm-image]][npm-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![npm download][download-image]][download-url]

[npm-image]: http://img.shields.io/npm/v/@rc-component/mini-decimal.svg?style=flat-square
[npm-url]: http://npmjs.org/package/@rc-component/mini-decimal
[github-actions-image]: https://github.com/react-component/mini-decimal/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/mini-decimal/actions
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/mini-decimal/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/react-component/mini-decimal/branch/master
[download-image]: https://img.shields.io/npm/dm/@rc-component/mini-decimal.svg?style=flat-square
[download-url]: https://npmjs.org/package/@rc-component/mini-decimal

## Development

```bash
npm install
npm test
```

## Usage

```tsx
import getMiniDecimal from '@rc-component/mini-decimal';

// Add
getMiniDecimal('0.1').add('0.2').toString(); // 0.3

// Multi
getMiniDecimal('0.1').multi('0.2').toString(); // 0.02

// Negate
getMiniDecimal('0.1').negate().toString(); // -0.1

// Equal
getMiniDecimal('0.1').equal('0.1'); // true
getMiniDecimal('0.1').equal('0.2'); // false

// Less Equals
getMiniDecimal('0.1').lessEquals('0.2'); // true
getMiniDecimal('0.1').lessEquals('0.1'); // false
```

---
_Source: https://npm.io/package/@rc-component/mini-decimal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
