abs and round filters
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
I have for example -17.00 price (minus seventeen and zero zero, it is the difference between current variant and default/first variant prices).
I'd like to get 17.00
When I apply:
{{ -17.00 | abs | round:2 }}
or
{{ -17.00 | round:2 | abs }}
I'm getting 17.0, not 17.00
How can I get 17.00 ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported Liquid expressions using -17.00 with the abs and round filters, then locate the filter implementation and its related tests. Determine whether preserving two decimal places is expected, and consider the work done when the behavior is covered by a test and the documented output matches the intended formatting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100