screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/17.0.2/umd/react.development.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.development.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script> </head> <body> <div id="app"></div> <script type="text/babel"> const {useState} = React; function App() { const [number, setNumber] = useState(123456789); // Replace with your number const formattedNumber = new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short', }).format(number); return ( <div className='container'> <h3>React Js Convert Number Into K Thousand M Million And B Billion</h3> <p>Original Number: {number}</p> <p>Formatted Number: {formattedNumber}</p> </div> ); } ReactDOM.render(<App />, document.getElementById("app")); </script> <style> /* Your custom CSS styles */ .container { margin: 0 auto; padding:20px; width: 400px; text-align: center; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); } </style> </body> </html>