screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script> <script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"></script> <script src="https://unpkg.com/@babel/standalone@7.14.7/babel.min.js"></script> </head> <body> <div id="app"></div> <script type="text/babel"> function App() { // The number you want to format const number = 987654321987; // Format the number with the US locale const USformatter = new Intl.NumberFormat("en-US"); const USformattedNumber = USformatter.format(number); return ( <div className='container'> <h3>React Js Number Format - US (comma separated)</h3> <p>Original Number: {number}</p> <p>US (comma separated): {USformattedNumber}</p> </div> ); } ReactDOM.render(<App />, document.getElementById("app")); </script> <style> .container { max-width: 500px; margin: 0 auto; padding: 20px; border-radius: 5px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); font-family: Arial, sans-serif; } </style> </body> </html>