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

Adding commas to separate thousands "("comma-separated values" or "comma formatting." ) #119

Open
lebu7 opened this issue Mar 8, 2024 · 0 comments

Comments

@lebu7
Copy link

lebu7 commented Mar 8, 2024

sanity doesn't add commas to its number types to separate thousands . To format them to make them more readable, you can use the following steps to add commas to the number types fetched, for example prices being displayed:
Screenshot 2024-03-08 at 18:48:20
Import the above components into your slug.js, product component, cart component or any other place you want to use it
Example of implementation on the total price in the cart component:
Screenshot 2024-03-08 at 18 51 26

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

1 participant