js实现两个数百分比运算
    Number.prototype.fixed = function(n) {
				with(Math) {
					return round(Number(this) * pow(10,n)) / pow(10, n);
				}
			} 
			var divide = function(d1, d2) {
				return d2 == 0 ? "0%" : (d1/d2*100).fixed(0) + "%";
			};
标签中使用:
<script type="text/javascript">document.write(divide(1, 2 />));</script>