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

Support Infinity as precision #16

Merged
merged 2 commits into from
Jan 16, 2020

Conversation

Richienb
Copy link
Contributor

@Richienb Richienb commented Dec 15, 2019

Specifying an infinite precision will assume infinite decimal places.

roundTo(0.1231782638, Infinity);
//=> 0.1231782638

cc @sindresorhus

…oints

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@sindresorhus
Copy link
Owner

@sindresorhus sindresorhus changed the title feat: If Infinity is provided as precision, assume infinite decimal places Support Infinity as precision Jan 15, 2020
@Richienb
Copy link
Contributor Author

@sindresorhus We shouldn't have to update any types since typeof Infinity === "number".

@sindresorhus
Copy link
Owner

The docs in the TS file.

@Richienb
Copy link
Contributor Author

Infinity is a type of number. microsoft/TypeScript#32277

@sindresorhus
Copy link
Owner

sindresorhus commented Jan 15, 2020

Please read my comment again. I'm talking about the docs not the types. The readme and TS file should be in sync documentation-wise.

@Richienb
Copy link
Contributor Author

@sindresorhus Oh right. 🤦‍♂

@sindresorhus sindresorhus merged commit dde468c into sindresorhus:master Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants