Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add number round #3533

Merged
merged 4 commits into from
Sep 4, 2024
Merged

Conversation

vinassefranche
Copy link
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Adds Number.round method to which you can pass a precision.
* assert.deepStrictEqual(round(5,1234, 2), 5.12)

Related

  • Related Issue #
  • Closes #

Copy link

changeset-bot bot commented Sep 2, 2024

🦋 Changeset detected

Latest commit: fb6a244

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
effect Minor
@effect/cli Major
@effect/cluster-browser Major
@effect/cluster-node Major
@effect/cluster-workflow Major
@effect/cluster Major
@effect/experimental Major
@effect/opentelemetry Major
@effect/platform-browser Major
@effect/platform-bun Major
@effect/platform-node-shared Major
@effect/platform-node Major
@effect/platform Major
@effect/printer-ansi Major
@effect/printer Major
@effect/rpc-http Major
@effect/rpc Major
@effect/schema Major
@effect/sql-d1 Major
@effect/sql-drizzle Major
@effect/sql-kysely Major
@effect/sql-mssql Major
@effect/sql-mysql2 Major
@effect/sql-pg Major
@effect/sql-sqlite-bun Major
@effect/sql-sqlite-node Major
@effect/sql-sqlite-react-native Major
@effect/sql-sqlite-wasm Major
@effect/sql Major
@effect/typeclass Major
@effect/vitest Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vinassefranche
Copy link
Contributor Author

I'm trying to remove lodash from my project in favor of native node features and effect features and this one was missing.
As the implementation was already in the repository, I thought it could be a good idea to export it.

@github-actions github-actions bot force-pushed the next-minor branch 2 times, most recently from 9c4ba21 to 5eb5ad7 Compare September 4, 2024 00:05
* import { round } from "effect/Number"
*
* assert.deepStrictEqual(round(5,1234, 2), 5.12)
* assert.deepStrictEqual(nextPow2(17), 32)
Copy link
Member

@tim-smart tim-smart Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed (nextPow2).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for that. I started to write the doc and stopped to write the tests first and forgot to come back to it.
There was also a mistake on the first line, by the way

@github-actions github-actions bot force-pushed the next-minor branch 3 times, most recently from 36a5be1 to 00583f3 Compare September 4, 2024 05:05
@tim-smart tim-smart merged commit 6d8ba6a into Effect-TS:next-minor Sep 4, 2024
11 checks passed
@github-actions github-actions bot mentioned this pull request Sep 4, 2024
@vinassefranche vinassefranche deleted the add-number-round branch September 4, 2024 09:47
github-actions bot pushed a commit that referenced this pull request Sep 5, 2024
github-actions bot pushed a commit that referenced this pull request Sep 5, 2024
github-actions bot pushed a commit that referenced this pull request Sep 5, 2024
github-actions bot pushed a commit that referenced this pull request Sep 6, 2024
github-actions bot pushed a commit that referenced this pull request Sep 6, 2024
github-actions bot pushed a commit that referenced this pull request Sep 6, 2024
github-actions bot pushed a commit that referenced this pull request Sep 7, 2024
tim-smart pushed a commit that referenced this pull request Sep 7, 2024
github-actions bot pushed a commit that referenced this pull request Sep 7, 2024
github-actions bot pushed a commit that referenced this pull request Sep 7, 2024
github-actions bot pushed a commit that referenced this pull request Sep 7, 2024
github-actions bot pushed a commit that referenced this pull request Sep 7, 2024
github-actions bot pushed a commit that referenced this pull request Sep 7, 2024
github-actions bot pushed a commit that referenced this pull request Sep 7, 2024
github-actions bot pushed a commit that referenced this pull request Sep 7, 2024
@tim-smart tim-smart mentioned this pull request Sep 9, 2024
github-actions bot pushed a commit that referenced this pull request Sep 9, 2024
github-actions bot pushed a commit that referenced this pull request Sep 9, 2024
github-actions bot pushed a commit that referenced this pull request Sep 10, 2024
github-actions bot pushed a commit that referenced this pull request Sep 10, 2024
github-actions bot pushed a commit that referenced this pull request Sep 10, 2024
github-actions bot pushed a commit that referenced this pull request Sep 10, 2024
github-actions bot pushed a commit that referenced this pull request Sep 11, 2024
github-actions bot pushed a commit that referenced this pull request Sep 11, 2024
github-actions bot pushed a commit that referenced this pull request Sep 12, 2024
github-actions bot pushed a commit that referenced this pull request Sep 12, 2024
github-actions bot pushed a commit that referenced this pull request Sep 13, 2024
github-actions bot pushed a commit that referenced this pull request Sep 13, 2024
github-actions bot pushed a commit that referenced this pull request Sep 13, 2024
github-actions bot pushed a commit that referenced this pull request Sep 13, 2024
github-actions bot pushed a commit that referenced this pull request Sep 13, 2024
github-actions bot pushed a commit that referenced this pull request Sep 13, 2024
github-actions bot pushed a commit that referenced this pull request Sep 15, 2024
tim-smart pushed a commit that referenced this pull request Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants