Scroll to top

how to remove value after decimal in javascript?

Remove value after decimal in javascript

<!DOCTYPE html>
<html>
<body>
<p>Value:</p>
<script>
var myFloat = 4.5;
var myTrunc = Math.trunc( myFloat );
document.write(myTrunc+ ” “);
</script>
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *