We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sum
When using the sum filter on an array containing floats, we get a BigDecimal result, which is rendered in scientific notation.
BigDecimal
require 'liquid' template = Liquid::Template.parse("Result: {{ a | sum }}") puts template.render!({"a" => [0.1, 0.2, 0.3]})
Output
Result: 0.6e0
Expected output
Result: 0.6
For consistency with existing math filters, would it be possible to convert a BigDecimal result to a float, just like the round filter does?
round
liquid/lib/liquid/standardfilters.rb
Line 791 in 77293d4
Many thanks.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
When using the
sum
filter on an array containing floats, we get aBigDecimal
result, which is rendered in scientific notation.Output
Expected output
For consistency with existing math filters, would it be possible to convert a
BigDecimal
result to a float, just like theround
filter does?liquid/lib/liquid/standardfilters.rb
Line 791 in 77293d4
Many thanks.
The text was updated successfully, but these errors were encountered: