Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
format percentage
Name: darkhalf Date: October 28, 2005 at 06:02:02 Pacific
Comment:
Hi,
Through my math function, I'm getting a percentage.. but how do you format it? I'm getting 1.5151515151515151% when I would like to have 1%...
var percent = done/total*100; document.getElementById('Percent').innerHTML = percent + "%";
Name: Michael J (by mjdamato) Date: October 28, 2005 at 10:58:39 Pacific
Reply:
var percent = Math.round(done/total*100); document.getElementById('Percent').innerHTML = percent + "%";
However, 1.515151 would round up to 2! If you do not want it rounded, but instead just want the whole number minus the remainder use Math.floor(done/total*100)
Summary: Hi, If i'm going to have a large movie streaming from a website which format would any of you recommend me using for 1) having the smallest file size and 2) for the most common;y used format which mos...
Summary: Your problem is probably a pretty simple one, but the code is tough to decipher with all these formatting problems. Why don't you upload the .php file as .txt and post it on your site. This would all...
Summary: My web application allows user to select certain part of my MySQL table for export and the route I want to offer is either XLS file or CSV. Exporting and saving works just fine in both formats, but ....