When I am trying to calculate the values My output has 15 digits in decimal values Like if x=3 Then in output it is showing 5.196152422706632
But how can I limit it to 5.19615
How to limit decimal digits in output from 15 digits to 5 digits in JavaScript? Here is my script:
<script>
function myFunction() {
var x = document.getElementById("phase").value;
document.getElementById("demo").innerHTML = "<b>V<sub>L</sub>is</b><br>" + Math.sqrt(3)*x + "volts";
}
</script>
How can I use this:
double number = 0.#############;
DecimalFormat numberFormat = new DecimalFormat("#.#####");