screen_rotation
Copied to Clipboard
<html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> <body> <div id="app"> <h2>Vue js toFixed() Method </h2> <p>Round two decimal places in Vue.js</p> <button @click="myFunction">Click me</button> <p>Number: {{number}}</p> <p>{{result}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ number:3.14567, result:'', } }, methods:{ myFunction(){ this.result = 'Rounded Two Decimal Places: ' + this.number.toFixed(2) } } }).mount('#app') </script> </body> </head> </html>