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

Feature Request: Format - Percent? #323

Open
kylepyke opened this issue Dec 15, 2023 · 1 comment
Open

Feature Request: Format - Percent? #323

kylepyke opened this issue Dec 15, 2023 · 1 comment

Comments

@kylepyke
Copy link

I'm wondering if it's possible in a future release to add a percent value to the format: option, to convert single decimal places to percentage. For example, 0.3 would become 30%.

This would be helpful for, say displaying volume for a media_player.

Thanks for all of your work on this repo!

@michluk
Copy link

michluk commented Apr 30, 2024

I came across this idea as well and would place a +1 for this feature.

I think adding something like

...
else if (config.format === 'percent') {
            value = Math.round(value * 100);
            unit = '%';
...

to the formatting part of the code (

if (config.format) {
) would already suffice.

Unfortunately, I am not into JS deployment. Therefore I would motivate someone else to look into this more deeply :-)

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