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>
We provide knowledgeable blogs related to php, jQuery, html, css, wordpress, woocommerce, cordova app with examples in 2021.
Comments
Post a Comment