Google Web after-hours

Contador en flash JSFL Traductor

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

One Response to 'Percent prototype'

  1. tostadense Says:

    Muy bueno Toni!!