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 = 1000000; // Format the number with the Indian locale const IndianFormatter = new Intl.NumberFormat("en-IN"); const IndianFormattedNumber = IndianFormatter.format(number); return ( <div className="container"> <h3>React Js Number format - Indian (comma separated)</h3> <p>Original Number: {number}</p> <p>Formatted Number (Indian): {IndianFormattedNumber}</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>