View Single Post
Old 04-13-2011, 12:16 AM   PM User | #4
bullant
Banned

 
Join Date: Feb 2011
Posts: 2,699
Thanks: 13
Thanked 395 Times in 395 Posts
bullant is on a distinguished road
There must be something else going on in your code that you haven't posted.

In this demo, the output in the alert() is 37.5

Code:
        
<script type="text/javascript">
            function displaymember(){
                var x = [1,2,3,4,5,6,7,8];
                
                var f=3;

                percent=f/x.length * 100;

                alert(percent);
            }
            displaymember();
</script>
bullant is offline   Reply With Quote