Comments (15)
It's a liquid problem. See how it works here: https://help.shopify.com/themes/liquid/filters/math-filters#floor
I don't want to mess with javascript just for this.
from moon.
There's also https://help.shopify.com/themes/liquid/filters/math-filters#ceil
from moon.
Didn't look that. Did you try? Is it working?
from moon.
I'm not actually that familiar with the layout of the theme and how it all interacts, so no, I haven't tested it myself. But, it looks like it's just a standard ceiling function. If you want me to test it I can do, you'll just have to point me in the right direction. :P
from moon.
Is there support for conditions? If so, floor could be used when the value is less than half way above the mark, and ceiling could be used when it's more. This would be more accurate than simply flooring or ceiling the value all the time.
from moon.
in _includes/read-time.html
,
changing
assign readtime = content | strip_html | number_of_words | divided_by:site.words_per_minute
to
assign readtime = content | strip_html | number_of_words | divided_by:site.words_per_minute | ceil
should work. I don't know right now.
I have an exam tomorrow, so I can't work on it today.
from moon.
That probably will not work, since divided_by apparently floors the value already. I'll test later.
from moon.
Ok, thank you. Let me know.
from moon.
@libeclipse this should fix this problem. It's working locally.
from moon.
for the reference: https://shopify.github.io/liquid/filters/divided_by/#controlling-rounding
from moon.
What's the expected behaviour now?
from moon.
With your example: 750 words / 200 word per minute = 3.75 minute and with rounding it's 4 minute. It was 3 minute before. This is what you want, isn't it? Am I misunderstood?
from moon.
So it rounds to the nearest minute now instead of flooring? If so, yeah
that's solved it.
On 16 Jun 2016 14:41, "Taylan Tatlı" [email protected] wrote:
With your example: 750 words / 200 word per minute = 3.75 minute and with
rounding it's 4 minute. It was 3 minute before. This is what you want,
isn't it? Am I misunderstood?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#29 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AIhzn0CeK7yXV8vGarFp2MiCuRknsBgTks5qMVJtgaJpZM4IvcEo
.
from moon.
Yep. It rounds to the nearest minute now.
from moon.
Sorted fam.
On 16 Jun 2016 14:51, "Taylan Tatlı" [email protected] wrote:
Yep. It rounds to the nearest minute now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#29 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AIhzn6NhrofLah3hIV-7RN8fdYMqsoHWks5qMVTRgaJpZM4IvcEo
.
from moon.
Related Issues (20)
- Accessibility errors found in your template
- Change the logo in navigation HOT 2
- could not load CSS & JS HOT 1
- "Could not find gem 'jekyll-sitemap' in any of the gem sources listed in your Gemfile." HOT 1
- Changing colour of the nav menu and the home hover button HOT 1
- Favicons from head.html not shown
- Image tag doesn't work
- Caption title for images in the popup
- unresponsive page
- Site Map Generation HOT 1
- Background image doesn't show on mobile browser HOT 1
- Missing _site and _plugins folder, can't generate sitemap HOT 1
- How to change the home page icon? HOT 1
- set images size HOT 1
- Images are not showing
- Share button in post section of Google+
- Post width
- How to change font size?
- Something wrong with highlighting HOT 1
- I always want to enable the comment feature, what should I do?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moon.