document.writeln(''); document.writeln(''); document.writeln('
'); document.writeln('
Amazon Royalties Estimator
'); document.writeln('
Change numbers in fields.
'); document.writeln('
Calculated results are rounded.
'); document.writeln('
'); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln('
Number of titles
Average —
Price
Royalty'); document.writeln(' 35%   70%'); document.writeln(''); document.writeln('
Delivery
Per book:
Books sold per title —
Per day
Per month
Per year*
Total royalty income —
Per day
Per month
Per year*
*365-day year.
'); document.writeln('
'); document.writeln('
With compliments of Wordpreneur
'); document.writeln('
and Will Bontrager Software LLC
'); document.writeln('
'); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln('var numtitles43347, price43347, rate43347, delivery43347, latestdelivery43347, readonly43347, numday43347, nummonth43347, numyear43347, royday43347, roymonth43347, royyear43347;'); document.writeln('InitialSetup43347();'); document.writeln(''); document.writeln('function InitialSetup43347()'); document.writeln('{'); document.writeln(' numtitles43347 = 3;'); document.writeln(' price43347 = 2.99;'); document.writeln(' delivery43347 = latestdelivery43347 = 0.06;'); document.writeln(' numday43347 = 10;'); document.writeln(' rate43347 = 0;'); document.writeln(' if( price43347 >= 2.99 && price43347 <= 9.99 )'); document.writeln(' {'); document.writeln(' rate43347 = 70;'); document.writeln(' doc'+'ument.getElementById("rate43347-35-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate43347-70-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate43347-amazon-royalties-estimator").value = 70;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' rate43347 = 35;'); document.writeln(' doc'+'ument.getElementById("rate43347-35-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate43347-70-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate43347-amazon-royalties-estimator").value = 35;'); document.writeln(' }'); document.writeln(' doc'+'ument.getElementById("numtitles43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(numtitles43347,0);'); document.writeln(' doc'+'ument.getElementById("price43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(price43347,2);'); document.writeln(' doc'+'ument.getElementById("delivery43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(delivery43347,2);'); document.writeln(' doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(numday43347,2);'); document.writeln(' FinishCalculation43347();'); document.writeln('}'); document.writeln(''); document.writeln('function UpdateAll43347()'); document.writeln('{'); document.writeln(' numtitles43347 = doc'+'ument.getElementById("numtitles43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numtitles43347 = parseInt(numtitles43347);'); document.writeln(' doc'+'ument.getElementById("numtitles43347-amazon-royalties-estimator").value = numtitles43347;'); document.writeln('// numtitles43347 = parseInt(doc'+'ument.getElementById("numtitles43347-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numtitles43347) )'); document.writeln(' {'); document.writeln(' numtitles43347 = 0;'); document.writeln(' doc'+'ument.getElementById("numtitles43347-amazon-royalties-estimator").value = numtitles43347;'); document.writeln(' }'); document.writeln(' price43347 = doc'+'ument.getElementById("price43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' price43347 = parseFloat(price43347);'); document.writeln(' doc'+'ument.getElementById("price43347-amazon-royalties-estimator").value = price43347;'); document.writeln('// price43347 = parseFloat(doc'+'ument.getElementById("price43347-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(price43347) )'); document.writeln(' {'); document.writeln(' price43347 = \'0.0\';'); document.writeln(' doc'+'ument.getElementById("price43347-amazon-royalties-estimator").value = price43347;'); document.writeln(' }'); document.writeln(' rate43347 = doc'+'ument.getElementById("rate43347-70-amazon-royalties-estimator").checked ? 70 : 35;'); document.writeln(' doc'+'ument.getElementById("rate43347-amazon-royalties-estimator").value = rate43347;'); document.writeln(' delivery43347 = doc'+'ument.getElementById("delivery43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' delivery43347 = parseFloat(delivery43347);'); document.writeln(' doc'+'ument.getElementById("delivery43347-amazon-royalties-estimator").value = delivery43347;'); document.writeln('// delivery43347 = parseFloat(doc'+'ument.getElementById("delivery43347-amazon-royalties-estimator").value);'); document.writeln(' doc'+'ument.getElementById("delivery43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347( parseFloat(doc'+'ument.getElementById("delivery43347-amazon-royalties-estimator").value), 2 );'); document.writeln(' if( rate43347 < 70 )'); document.writeln(' {'); document.writeln(' if( delivery43347 > 0 ) { latestdelivery43347 = delivery43347; }'); document.writeln(' doc'+'ument.getElementById("delivery43347-amazon-royalties-estimator").value = \'0.00\';'); document.writeln(' delivery43347 = 0.0;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' if( delivery43347 <= 0 && latestdelivery43347 > 0 )'); document.writeln(' {'); document.writeln(' delivery43347 = latestdelivery43347;'); document.writeln(' doc'+'ument.getElementById("delivery43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(delivery43347,2);'); document.writeln(' }'); document.writeln(' }'); document.writeln(''); document.writeln(' if( isNaN(delivery43347) )'); document.writeln(' {'); document.writeln(' delivery43347 = \'0.00\';'); document.writeln(' doc'+'ument.getElementById("delivery43347-amazon-royalties-estimator").value = delivery43347;'); document.writeln(' }'); document.writeln(' readonly43347 = ( numday43347 * (rate43347/100) ) - delivery43347;'); document.writeln(' numday43347 = doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday43347 = parseInt(numday43347);'); document.writeln(' doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value = numday43347;'); document.writeln('// numday43347 = parseInt(doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday43347) )'); document.writeln(' {'); document.writeln(' numday43347 = 0;'); document.writeln(' doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value = numday43347;'); document.writeln(' }'); document.writeln(' FinishCalculation43347();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerDay43347()'); document.writeln('{'); document.writeln(' numday43347 = doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday43347 = parseInt(numday43347);'); document.writeln(' doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value = numday43347;'); document.writeln('// numday43347 = parseInt(doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday43347) ) { numday43347 = 0; }'); document.writeln(' DetermineNumberSoldPerPeriods43347();'); document.writeln(' CalculateRoyaltyNumbers43347();'); document.writeln(' Update7Values43347();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerMonth43347()'); document.writeln('{'); document.writeln(' nummonth43347 = doc'+'ument.getElementById("nummonth43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' nummonth43347 = parseInt(nummonth43347);'); document.writeln(' doc'+'ument.getElementById("nummonth43347-amazon-royalties-estimator").value = nummonth43347;'); document.writeln('// nummonth43347 = parseInt(doc'+'ument.getElementById("nummonth43347-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(nummonth43347) ) { nummonth43347 = 0; }'); document.writeln(' numyear43347 = nummonth43347 * 12;'); document.writeln(' numday43347 = numyear43347 / 365;'); document.writeln(' doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value = numday43347;'); document.writeln(' doc'+'ument.getElementById("nummonth43347-amazon-royalties-estimator").value = nummonth43347;'); document.writeln(' doc'+'ument.getElementById("numyear43347-amazon-royalties-estimator").value = numyear43347;'); document.writeln(' CalculateRoyaltyNumbers43347();'); document.writeln(' Update7Values43347();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerYear43347()'); document.writeln('{'); document.writeln(' numyear43347 = doc'+'ument.getElementById("numyear43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numyear43347 = parseInt(numyear43347);'); document.writeln(' doc'+'ument.getElementById("numyear43347-amazon-royalties-estimator").value = numyear43347;'); document.writeln('// numyear43347 = parseInt(doc'+'ument.getElementById("numyear43347-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numyear43347) ) { numyear43347 = 0; }'); document.writeln(' numday43347 = numyear43347 / 365;'); document.writeln(' nummonth43347 = numyear43347 / 12;'); document.writeln(' doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value = numday43347;'); document.writeln(' doc'+'ument.getElementById("nummonth43347-amazon-royalties-estimator").value = nummonth43347;'); document.writeln(' doc'+'ument.getElementById("numyear43347-amazon-royalties-estimator").value = numyear43347;'); document.writeln(' CalculateRoyaltyNumbers43347();'); document.writeln(' Update7Values43347();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerDay43347()'); document.writeln('{'); document.writeln(' royday43347 = doc'+'ument.getElementById("royday43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royday43347 = parseFloat(royday43347);'); document.writeln(' doc'+'ument.getElementById("royday43347-amazon-royalties-estimator").value = royday43347;'); document.writeln('// royday43347 = parseFloat(doc'+'ument.getElementById("royday43347-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royday43347) ) { royday43347 = 0; }'); document.writeln(' royyear43347 = royday43347 * 365;'); document.writeln(' roymonth43347 = royyear43347 / 12;'); document.writeln(' numday43347 = royday43347 / (readonly43347 * numtitles43347);'); document.writeln(' DetermineNumberSoldPerPeriods43347()'); document.writeln(' Update7Values43347();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerMonth43347()'); document.writeln('{'); document.writeln(' roymonth43347 = doc'+'ument.getElementById("roymonth43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' roymonth43347 = parseFloat(roymonth43347);'); document.writeln(' doc'+'ument.getElementById("roymonth43347-amazon-royalties-estimator").value = roymonth43347;'); document.writeln('// roymonth43347 = parseFloat(doc'+'ument.getElementById("roymonth43347-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(roymonth43347) ) { roymonth43347 = 0; }'); document.writeln(' royyear43347 = roymonth43347 * 12;'); document.writeln(' royday43347 = royyear43347 / 365;'); document.writeln(' numday43347 = royday43347 / (readonly43347 * numtitles43347);'); document.writeln(' DetermineNumberSoldPerPeriods43347()'); document.writeln(' Update7Values43347();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerYear43347()'); document.writeln('{'); document.writeln(' royyear43347 = doc'+'ument.getElementById("royyear43347-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royyear43347 = parseFloat(royyear43347);'); document.writeln(' doc'+'ument.getElementById("royyear43347-amazon-royalties-estimator").value = royyear43347;'); document.writeln('// royyear43347 = parseFloat(doc'+'ument.getElementById("royyear43347-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royyear43347) ) { royyear43347 = 0; }'); document.writeln(' royday43347 = royyear43347 / 365;'); document.writeln(' roymonth43347 = royyear43347 / 12;'); document.writeln(' numday43347 = royday43347 / (readonly43347 * numtitles43347);'); document.writeln(' DetermineNumberSoldPerPeriods43347()'); document.writeln(' Update7Values43347();'); document.writeln('}'); document.writeln(''); document.writeln('function DetermineNumberSoldPerPeriods43347()'); document.writeln('{'); document.writeln(' numyear43347 = numday43347 * 365;'); document.writeln(' nummonth43347 = numyear43347 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function FinishCalculation43347()'); document.writeln('{'); document.writeln(' Calculate6Numbers43347();'); document.writeln(' Update7Values43347();'); document.writeln('}'); document.writeln(''); document.writeln('function Calculate6Numbers43347()'); document.writeln('{'); document.writeln(' // numday43347 is assumed to be have the correct value.'); document.writeln(' readonly43347 = ( price43347 * (rate43347/100) ) - delivery43347;'); document.writeln(' DetermineNumberSoldPerPeriods43347();'); document.writeln(' royday43347 = numtitles43347 * readonly43347 * numday43347;'); document.writeln(' royyear43347 = royday43347 * 365;'); document.writeln(' roymonth43347 = royyear43347 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function CalculateRoyaltyNumbers43347()'); document.writeln('{'); document.writeln(' // numday43347 is assumed to be have the correct value.'); document.writeln(' readonly43347 = ( price43347 * (rate43347/100) ) - delivery43347;'); document.writeln(' royday43347 = numtitles43347 * readonly43347 * numday43347;'); document.writeln(' royyear43347 = royday43347 * 365;'); document.writeln(' roymonth43347 = royyear43347 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function Update7Values43347()'); document.writeln('{'); document.writeln('//rate43347-35-amazon-royalties-estimator'); document.writeln(' doc'+'ument.getElementById("readonly43347-amazon-royalties-estimator").innerHTML = ReturnCurrencyNumberCommaized43347(readonly43347,2);'); document.writeln(' doc'+'ument.getElementById("numday43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(numday43347,0);'); document.writeln(' doc'+'ument.getElementById("nummonth43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(nummonth43347,0);'); document.writeln(' doc'+'ument.getElementById("numyear43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(numyear43347,0);'); document.writeln(' doc'+'ument.getElementById("royday43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(royday43347,2);'); document.writeln(' doc'+'ument.getElementById("roymonth43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(roymonth43347,2);'); document.writeln(' doc'+'ument.getElementById("royyear43347-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized43347(royyear43347,2);'); document.writeln('}'); document.writeln(''); document.writeln('function ReturnCurrencyNumber43347(n,d) { return n.toFixed(d); }'); document.writeln(''); document.writeln('function ReturnCurrencyNumberCommaized43347(n,d)'); document.writeln('{'); document.writeln(' var number = ReturnCurrencyNumber43347(n,d);'); document.writeln('return number;'); document.writeln(' var ta = number.split(\'.\',2);'); document.writeln(' if( ta[0] < 10000 ) { return number; }'); document.writeln(' var holder = new Array();'); document.writeln(' while( ta[0] > 999 )'); document.writeln(' {'); document.writeln('alert(n + "***" + number + \'***\' + ta[0]);'); document.writeln(' holder.unshift( ta[0].substr(-3) );'); document.writeln(' ta[0] = ta[0].substr(0,ta[0].length-3);'); document.writeln('alert( ta[0] + "---" + holder.join(\',\') );'); document.writeln(' }'); document.writeln(' ta[0] = holder.join(",");'); document.writeln(' return ta.join(".");'); document.writeln('}'); document.writeln(''); document.writeln(''); document.writeln('');