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

[bug]: animated.div exception removes the zeros from the end of the number. #2265

Open
1 of 5 tasks
lomocc opened this issue Mar 25, 2024 · 0 comments
Open
1 of 5 tasks
Labels
template: bug This issue might be a bug

Comments

@lomocc
Copy link

lomocc commented Mar 25, 2024

Which react-spring target are you using?

  • @react-spring/web
  • @react-spring/three
  • @react-spring/native
  • @react-spring/konva
  • @react-spring/zdog

What version of react-spring are you using?

9.7.3

What's Wrong?

animated.div will remove the .00 end of the number

To Reproduce

https://codesandbox.io/p/sandbox/ecstatic-https-t8kt3d?file=%2Fsrc%2FApp.tsx%3A14%2C9

first click the number, second click the update.

Expected Behaviour

<animated.div className={styles.content}>{props.width.to(x => x.toFixed(2))}</animated.div>

should always display the toFixed(2) number, just like 200.00

Link to repo

https://codesandbox.io/p/sandbox/ecstatic-https-t8kt3d?file=%2Fsrc%2FApp.tsx%3A14%2C9

@lomocc lomocc added the template: bug This issue might be a bug label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
template: bug This issue might be a bug
Projects
None yet
Development

No branches or pull requests

1 participant