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

Ability to Choose Decimal Rounding Option for in the Plugin #2874

Open
keeganedwin opened this issue Jun 18, 2024 · 1 comment
Open

Ability to Choose Decimal Rounding Option for in the Plugin #2874

keeganedwin opened this issue Jun 18, 2024 · 1 comment
Labels

Comments

@keeganedwin
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Change the way or have an option in the plugin to not always round 4 digit decimals down to 3 digits? (SD also has the same output).

Use case:
image (35)

Important Information:
here’s the link describing how the plugin rounds decimals. It’s something we can change but [@six7](https://tokens studio.slack.com/team/U02DEJT4F1Q) will have to comment on this.

The Number.parseFloat(evaluated.toFixed(3)) part is executed.
evaluated.toFixed(3) converts evaluated to a string containing a number with exactly three decimal places.
Number.parseFloat(...) converts this string back to a number (float).
Example: If evaluated = 100.123456 and the unit is false (e.g. null or undefined), then the return value will be 100.123

Describe the solution you'd like
As per @six7 reply - We could add this as a QOL improvement as one of the followup releases.

From user - It should ideally be a configurable value

@onurorhon
Copy link

onurorhon commented Jul 3, 2024

@keeganedwin here is the related SD-transform ticket, if you want to add to the description:
tokens-studio/sd-transforms#289

@SamIam4Hyma SamIam4Hyma added token value QOL Quality of Life improvements and removed plugin v2 variables, UI, WTCG format, Bitbucket labels Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📥 Triage
Development

No branches or pull requests

5 participants