percent prototype
Extrae el porcentaje de una variable
Parámetros $percent
Number.prototype.percent = function($percent) {
return (this/$percent);
};
Ejemplos de uso
var a = 100; trace(a.percent(20)); // retorna 5 // -- str= a.percent(10); trace(str); // retorna 10 // -- a = a.percent(5); trace(a); // retorna 20
Diciembre 7th, 2004 at 8:07 pm
Muy bueno Toni!!