May
21
2009
How many Wheatons in a Kutcher?
This will make much more sense if you read this first: Tinyurl.com/milliwheaton
Base Measurements:
1 Kutcher = 3,000,000 followers
1 FelDay = 1,000,000 followers
1 Wheaton = 500,000 followers
1 Gaiman = 400,000 followers
And I declared these values in the lack of data
1 Fry = 499,986 followers
1 Hodgman = 55,554 followers
1 Coulton = 27,777 followers
1 Whedon = 9,259 followers
Where 1 Fry = 9 Hodgmans = 18 Coultons = 54 Whedons
And in case you forgot:
Deci = 1/10
Centi = 1/100
Milli = 1/1,000
Micro = 1/1,000,000
Nano = 1/1,000,000,000
Source Code
function convertToCeleb(followers, user, unitName, unitValue) {
var deci = .1;
var centi = .01;
var milli = .001;
var micro = .000001;
var nano = .000000001;
/*
1 kutcher = 3000000;
1 felday = 1000000;
1 wheaton = 500000 ;
1 gaiman = 400000;
*/
var baseUnit = unitValue;
var h = followers + " Followers = ";
var result = "";
// Base Unit
var wunit = Math.round(followers/baseUnit,0);
if(wunit>0) result = result + wunit + " "+unitName+"s";
followers = followers%baseUnit;
if(result && followers>(deci*baseUnit)) result = result + ", ";
// DeciUnit
wunit = Math.round(followers/(deci*baseUnit),0)
if(wunit>0) result = result + wunit + " deci"+unitName+"s";
followers = followers%(deci*baseUnit);
if(result && followers>(centi*baseUnit)) result = result + ", ";
// centiUnit
wunit = Math.round(followers/(centi*baseUnit),0)
if(wunit>0) result = result + wunit + " centi"+unitName+"s";
followers = followers%(centi*baseUnit);
if(result && followers>(milli*baseUnit)) result = result + ", ";
// milliUnit
wunit = Math.round(followers/(milli*baseUnit),0)
if(wunit>0) result = result + wunit + " milli"+unitName+"s";
followers = followers%(milli*baseUnit);
if(result && followers>(micro*baseUnit)) result = result + ", ";
// microUnit
wunit = Math.round(followers/(micro*baseUnit))
if(wunit>0) result = result + wunit + " micro"+unitName+"s";
followers = followers%(micro*baseUnit);
if(result && followers>0) result = result + ", ";
// nanoUnit
wunit = Math.round(followers/(nano*baseUnit))
if(wunit>0) result = result + wunit + " nano"+unitName+"s";
result = '@' + user +" has " + result;
if(result.length< 127)
result = result + " #milliwheaton";
if(result.length< 106)
result = result + " via http://tinyurl.com/wheatoncalc"
if(result.length< 107)
result = result + " & http://tinyurl.com/milliwheaton"
return result;
}