Skip to content

Commit

Permalink
Merge tag 'v1.0.0' into develop
Browse files Browse the repository at this point in the history
v1.0.0

- initial release

See CHANGELOG.md for details
  • Loading branch information
stuartherbert committed Apr 5, 2024
2 parents 997a0fc + 2b0f5ae commit 5c375d0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ For each release, changes are grouped under these headings:

The following changes have been completed, and will be included in the next tagged release.

## v1.0.0

Released Friday 5th April 2024.

### New

- added `roundDown()` function
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ const roundedDownRes = roundDown(
);
```

## Why Another Math Rounding Package?

I found myself needing rounding functions in [CSS Color](https://github.com/SafelyTyped/ts-css-color) that Javascript's stock `Math` module doesn't provide. I've published them as a separate package so that I can reuse them in other packages in the future.

But this isn't the world's first package to add missing `Math` rounding functions to Javascript / Typescript ... so why have I built it?

The main reason is that it follows the SafelyTyped philosophy of function parameter order:

- required modifier params come first,
- then the main input value

I find that this makes partial functions a little more readable, such as:

```typescript
import { roundDown } from "@safelytyped/ts-math-rounding";

const roundDown2 = (x: number) => roundDown(2, x);
```

## Documentation

Here's a link to all the documentation about this project.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@safelytyped/math-rounding",
"version": "0.0.0",
"version": "1.0.0",
"description": "Math rounding utilities",
"repository": "github:SafelyTyped/math-rounding",
"main": "lib/cjs/index.js",
Expand Down

0 comments on commit 5c375d0

Please sign in to comment.