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

Rounding (round/floor/ceil) template functions #3883

Closed
jetwash opened this issue Sep 13, 2017 · 1 comment · Fixed by #3901
Closed

Rounding (round/floor/ceil) template functions #3883

jetwash opened this issue Sep 13, 2017 · 1 comment · Fixed by #3901

Comments

@jetwash
Copy link

jetwash commented Sep 13, 2017

Title is pretty self-explanatory.

int can be used instead of floor, but it's a bit of a hack… if you add round/ceil IMHO you may as well add floor, too.

Until this is resolved I plan to work around the lack of ceil with cond (lt (int $x) $x) (int (add $x 1)) (int $x). Round could be emulated in a similar fashion (untested) cond (lt $x ((int $x) + 0.5)) (int $x) (add (int $x) 1).

@bep bep added this to the v0.28 milestone Sep 13, 2017
@bep bep modified the milestones: v0.28, v0.29 Sep 21, 2017
moorereason added a commit to moorereason/hugo that referenced this issue Sep 24, 2017
Ceil and Floor are frontends for the stdlib math functions. The Round
implementation is essentially the same thing except that the Go stdlib
doesn't include a Round implementation in a stable release yet.  I've
included the Round function slated for Go 1.10.

Fixes gohugoio#3883
@bep bep closed this as completed in #3901 Sep 24, 2017
bep pushed a commit that referenced this issue Sep 24, 2017
Ceil and Floor are frontends for the stdlib math functions. The Round
implementation is essentially the same thing except that the Go stdlib
doesn't include a Round implementation in a stable release yet.  I've
included the Round function slated for Go 1.10.

Fixes #3883
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants