i need to check a variable whether it is an integer or a decimal one. if integer just have to showing the integer if is not show the decimal point up 2. i just used the
toFixed(2)
but it will show the integer number also with two decimal points
<script>
function getDisco() {
gross = "<?php echo $GROSS_NET ?>";
dis = document.getElementById('Discount').value;
document.form3.Discount.value = ((dis/100) * 100).toFixed(2) ;
document.form3.dis_perc.value = (((dis/gross) * 100)).toFixed(2) ;
document.form3.net_tot.value = (gross - dis).toFixed(2);
document.form3.gross.value = ((gross/100) * 100).toFixed(2);
}
</script>