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

Percentage Filter #84

Closed
dderjoel opened this issue Jan 13, 2020 · 2 comments
Closed

Percentage Filter #84

dderjoel opened this issue Jan 13, 2020 · 2 comments

Comments

@dderjoel
Copy link

I was wondering if a small percentage Filter would be an useful addition:
currently, we use in our project.

export const percentFilter = (value = 0.0, decimals = 0): string => {
  return `${(value * 100).toFixed(decimals)} %`;
};

I know its just a very small addition, but it will make (at least my) code base cleaner, since I can use formatter: (v: number): string => this.$options.filters.percent(v)

feel free to make suggestions

freearhey added a commit that referenced this issue Feb 19, 2020
@freearhey
Copy link
Owner

@dderjoel I'm sorry for such a long delay, but I finally found some free time and added this filter to the package.

I've already published the beta version v0.10.0-beta.1 and it would be great if you could test it. And if there are no bugs, then I'll make the final release.

@dderjoel
Copy link
Author

Works well, thank you for adding it!

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

2 participants