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

Calculate the percentage #10

Open
ceccadroid opened this issue Aug 31, 2022 · 2 comments
Open

Calculate the percentage #10

ceccadroid opened this issue Aug 31, 2022 · 2 comments

Comments

@ceccadroid
Copy link

Hi. I wonder if there's a way to automatically calculate the percentage of completion from note's frontmatter.
In my case I have, with other keys,:
Total:
Seen:
for the total number of episodes in my series and how many I've already seen. So I wish to pass to the progress bar the result of (round(seen/Total*100))
I hope you can understand what I mean
Thanks in advance for any help

@fredericojordan
Copy link
Owner

Hello!
I have never used frontmatter, but I will try to help.
Is there any way to create a new variable with the value round(seen/Total*100)?
Or maybe you can calculate it directly in the link: https://progress-bar.dev/{100*seen/Total}/
Let me know if any of these options work.

@johnkershaw
Copy link

Given that this would normally be expressed as a fraction, ie seen/total, maybe the most logical way would to handle redirection of the form
https://progress-bar.dev/seen/Total

ie
https://progress-bar.dev/15/20
would display a 75% progress bar if you've watched 15 out of 20 (or maybe it should show 15 in the left half of the bar and 20 in the right half?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants