-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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 float
function to parse string to floating point value
#3307
Comments
Agreed, the addition of a Is something similar already on the roadmap? Many thanks in advance. |
Hi from a Hacktoberfestler 👋 I'd like to give implementing this a try! |
@x3ro great; it should live in the /cc @moorereason |
Add a template function that allows conversion to float. This is useful, for example, when passing aspect ratios into templates, which tend to not be integers. Fixes gohugoio#3307
Add a template function that allows conversion to float. This is useful, for example, when passing aspect ratios into templates, which tend to not be integers. Fixes gohugoio#3307
Add a template function that allows conversion to float. This is useful, for example, when passing aspect ratios into templates, which tend to not be integers. Fixes gohugoio#3307
Add a template function that allows conversion to float. This is useful, for example, when passing aspect ratios into templates, which tend to not be integers. Fixes gohugoio#3307
Add a template function that allows conversion to float. This is useful, for example, when passing aspect ratios into templates, which tend to not be integers. Fixes #3307
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. |
Please add a
float
function so that we can convert a string into a floating point number, analogous to theint
function for integers.This will allow us to pass named floating point arguments from a shortcode.
For my use-case, this is to pass a non-integer "aspect ratio" value. My current workaround is to supply this as a rational two-integer tuple and to perform the division in the template, but is only an approximation when the value is irrational.
The text was updated successfully, but these errors were encountered: