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

Precision for nested calc is not accurate #66

Closed
andreymal opened this issue Dec 21, 2018 · 2 comments · Fixed by #75
Closed

Precision for nested calc is not accurate #66

andreymal opened this issue Dec 21, 2018 · 2 comments · Fixed by #75

Comments

@andreymal
Copy link

.foo {
  width: calc(100% / 3 * 3);
  height: calc(calc(100% / 3) * 3);
}

Expected output:

.foo {
  width: 100%;
  height: 100%;
}

Actual output:

.foo {
  width: 100%;
  height: 99.99999%;
}

reduce-css-calc is also affected

Note that it works in Firefox and Chrome:

@Semigradsky
Copy link
Member

Semigradsky commented Dec 27, 2018

@andreymal Just increase precision parameter:
https://github.com/postcss/postcss-calc#precision-default-5

@andreymal
Copy link
Author

@Semigradsky no, I want precision=5 with correct rounding

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 a pull request may close this issue.

2 participants