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 numtitles98269, price98269, rate98269, delivery98269, latestdelivery98269, readonly98269, numday98269, nummonth98269, numyear98269, royday98269, roymonth98269, royyear98269;'); document.writeln('InitialSetup98269();'); document.writeln(''); document.writeln('function InitialSetup98269()'); document.writeln('{'); document.writeln(' numtitles98269 = 3;'); document.writeln(' price98269 = 2.99;'); document.writeln(' delivery98269 = latestdelivery98269 = 0.06;'); document.writeln(' numday98269 = 10;'); document.writeln(' rate98269 = 0;'); document.writeln(' if( price98269 >= 2.99 && price98269 <= 9.99 )'); document.writeln(' {'); document.writeln(' rate98269 = 70;'); document.writeln(' doc'+'ument.getElementById("rate98269-35-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate98269-70-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate98269-amazon-royalties-estimator").value = 70;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' rate98269 = 35;'); document.writeln(' doc'+'ument.getElementById("rate98269-35-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate98269-70-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate98269-amazon-royalties-estimator").value = 35;'); document.writeln(' }'); document.writeln(' doc'+'ument.getElementById("numtitles98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(numtitles98269,0);'); document.writeln(' doc'+'ument.getElementById("price98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(price98269,2);'); document.writeln(' doc'+'ument.getElementById("delivery98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(delivery98269,2);'); document.writeln(' doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(numday98269,2);'); document.writeln(' FinishCalculation98269();'); document.writeln('}'); document.writeln(''); document.writeln('function UpdateAll98269()'); document.writeln('{'); document.writeln(' numtitles98269 = doc'+'ument.getElementById("numtitles98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numtitles98269 = parseInt(numtitles98269);'); document.writeln(' doc'+'ument.getElementById("numtitles98269-amazon-royalties-estimator").value = numtitles98269;'); document.writeln('// numtitles98269 = parseInt(doc'+'ument.getElementById("numtitles98269-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numtitles98269) )'); document.writeln(' {'); document.writeln(' numtitles98269 = 0;'); document.writeln(' doc'+'ument.getElementById("numtitles98269-amazon-royalties-estimator").value = numtitles98269;'); document.writeln(' }'); document.writeln(' price98269 = doc'+'ument.getElementById("price98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' price98269 = parseFloat(price98269);'); document.writeln(' doc'+'ument.getElementById("price98269-amazon-royalties-estimator").value = price98269;'); document.writeln('// price98269 = parseFloat(doc'+'ument.getElementById("price98269-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(price98269) )'); document.writeln(' {'); document.writeln(' price98269 = \'0.0\';'); document.writeln(' doc'+'ument.getElementById("price98269-amazon-royalties-estimator").value = price98269;'); document.writeln(' }'); document.writeln(' rate98269 = doc'+'ument.getElementById("rate98269-70-amazon-royalties-estimator").checked ? 70 : 35;'); document.writeln(' doc'+'ument.getElementById("rate98269-amazon-royalties-estimator").value = rate98269;'); document.writeln(' delivery98269 = doc'+'ument.getElementById("delivery98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' delivery98269 = parseFloat(delivery98269);'); document.writeln(' doc'+'ument.getElementById("delivery98269-amazon-royalties-estimator").value = delivery98269;'); document.writeln('// delivery98269 = parseFloat(doc'+'ument.getElementById("delivery98269-amazon-royalties-estimator").value);'); document.writeln(' doc'+'ument.getElementById("delivery98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269( parseFloat(doc'+'ument.getElementById("delivery98269-amazon-royalties-estimator").value), 2 );'); document.writeln(' if( rate98269 < 70 )'); document.writeln(' {'); document.writeln(' if( delivery98269 > 0 ) { latestdelivery98269 = delivery98269; }'); document.writeln(' doc'+'ument.getElementById("delivery98269-amazon-royalties-estimator").value = \'0.00\';'); document.writeln(' delivery98269 = 0.0;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' if( delivery98269 <= 0 && latestdelivery98269 > 0 )'); document.writeln(' {'); document.writeln(' delivery98269 = latestdelivery98269;'); document.writeln(' doc'+'ument.getElementById("delivery98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(delivery98269,2);'); document.writeln(' }'); document.writeln(' }'); document.writeln(''); document.writeln(' if( isNaN(delivery98269) )'); document.writeln(' {'); document.writeln(' delivery98269 = \'0.00\';'); document.writeln(' doc'+'ument.getElementById("delivery98269-amazon-royalties-estimator").value = delivery98269;'); document.writeln(' }'); document.writeln(' readonly98269 = ( numday98269 * (rate98269/100) ) - delivery98269;'); document.writeln(' numday98269 = doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday98269 = parseInt(numday98269);'); document.writeln(' doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value = numday98269;'); document.writeln('// numday98269 = parseInt(doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday98269) )'); document.writeln(' {'); document.writeln(' numday98269 = 0;'); document.writeln(' doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value = numday98269;'); document.writeln(' }'); document.writeln(' FinishCalculation98269();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerDay98269()'); document.writeln('{'); document.writeln(' numday98269 = doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday98269 = parseInt(numday98269);'); document.writeln(' doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value = numday98269;'); document.writeln('// numday98269 = parseInt(doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday98269) ) { numday98269 = 0; }'); document.writeln(' DetermineNumberSoldPerPeriods98269();'); document.writeln(' CalculateRoyaltyNumbers98269();'); document.writeln(' Update7Values98269();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerMonth98269()'); document.writeln('{'); document.writeln(' nummonth98269 = doc'+'ument.getElementById("nummonth98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' nummonth98269 = parseInt(nummonth98269);'); document.writeln(' doc'+'ument.getElementById("nummonth98269-amazon-royalties-estimator").value = nummonth98269;'); document.writeln('// nummonth98269 = parseInt(doc'+'ument.getElementById("nummonth98269-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(nummonth98269) ) { nummonth98269 = 0; }'); document.writeln(' numyear98269 = nummonth98269 * 12;'); document.writeln(' numday98269 = numyear98269 / 365;'); document.writeln(' doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value = numday98269;'); document.writeln(' doc'+'ument.getElementById("nummonth98269-amazon-royalties-estimator").value = nummonth98269;'); document.writeln(' doc'+'ument.getElementById("numyear98269-amazon-royalties-estimator").value = numyear98269;'); document.writeln(' CalculateRoyaltyNumbers98269();'); document.writeln(' Update7Values98269();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerYear98269()'); document.writeln('{'); document.writeln(' numyear98269 = doc'+'ument.getElementById("numyear98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numyear98269 = parseInt(numyear98269);'); document.writeln(' doc'+'ument.getElementById("numyear98269-amazon-royalties-estimator").value = numyear98269;'); document.writeln('// numyear98269 = parseInt(doc'+'ument.getElementById("numyear98269-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numyear98269) ) { numyear98269 = 0; }'); document.writeln(' numday98269 = numyear98269 / 365;'); document.writeln(' nummonth98269 = numyear98269 / 12;'); document.writeln(' doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value = numday98269;'); document.writeln(' doc'+'ument.getElementById("nummonth98269-amazon-royalties-estimator").value = nummonth98269;'); document.writeln(' doc'+'ument.getElementById("numyear98269-amazon-royalties-estimator").value = numyear98269;'); document.writeln(' CalculateRoyaltyNumbers98269();'); document.writeln(' Update7Values98269();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerDay98269()'); document.writeln('{'); document.writeln(' royday98269 = doc'+'ument.getElementById("royday98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royday98269 = parseFloat(royday98269);'); document.writeln(' doc'+'ument.getElementById("royday98269-amazon-royalties-estimator").value = royday98269;'); document.writeln('// royday98269 = parseFloat(doc'+'ument.getElementById("royday98269-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royday98269) ) { royday98269 = 0; }'); document.writeln(' royyear98269 = royday98269 * 365;'); document.writeln(' roymonth98269 = royyear98269 / 12;'); document.writeln(' numday98269 = royday98269 / (readonly98269 * numtitles98269);'); document.writeln(' DetermineNumberSoldPerPeriods98269()'); document.writeln(' Update7Values98269();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerMonth98269()'); document.writeln('{'); document.writeln(' roymonth98269 = doc'+'ument.getElementById("roymonth98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' roymonth98269 = parseFloat(roymonth98269);'); document.writeln(' doc'+'ument.getElementById("roymonth98269-amazon-royalties-estimator").value = roymonth98269;'); document.writeln('// roymonth98269 = parseFloat(doc'+'ument.getElementById("roymonth98269-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(roymonth98269) ) { roymonth98269 = 0; }'); document.writeln(' royyear98269 = roymonth98269 * 12;'); document.writeln(' royday98269 = royyear98269 / 365;'); document.writeln(' numday98269 = royday98269 / (readonly98269 * numtitles98269);'); document.writeln(' DetermineNumberSoldPerPeriods98269()'); document.writeln(' Update7Values98269();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerYear98269()'); document.writeln('{'); document.writeln(' royyear98269 = doc'+'ument.getElementById("royyear98269-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royyear98269 = parseFloat(royyear98269);'); document.writeln(' doc'+'ument.getElementById("royyear98269-amazon-royalties-estimator").value = royyear98269;'); document.writeln('// royyear98269 = parseFloat(doc'+'ument.getElementById("royyear98269-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royyear98269) ) { royyear98269 = 0; }'); document.writeln(' royday98269 = royyear98269 / 365;'); document.writeln(' roymonth98269 = royyear98269 / 12;'); document.writeln(' numday98269 = royday98269 / (readonly98269 * numtitles98269);'); document.writeln(' DetermineNumberSoldPerPeriods98269()'); document.writeln(' Update7Values98269();'); document.writeln('}'); document.writeln(''); document.writeln('function DetermineNumberSoldPerPeriods98269()'); document.writeln('{'); document.writeln(' numyear98269 = numday98269 * 365;'); document.writeln(' nummonth98269 = numyear98269 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function FinishCalculation98269()'); document.writeln('{'); document.writeln(' Calculate6Numbers98269();'); document.writeln(' Update7Values98269();'); document.writeln('}'); document.writeln(''); document.writeln('function Calculate6Numbers98269()'); document.writeln('{'); document.writeln(' // numday98269 is assumed to be have the correct value.'); document.writeln(' readonly98269 = ( price98269 * (rate98269/100) ) - delivery98269;'); document.writeln(' DetermineNumberSoldPerPeriods98269();'); document.writeln(' royday98269 = numtitles98269 * readonly98269 * numday98269;'); document.writeln(' royyear98269 = royday98269 * 365;'); document.writeln(' roymonth98269 = royyear98269 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function CalculateRoyaltyNumbers98269()'); document.writeln('{'); document.writeln(' // numday98269 is assumed to be have the correct value.'); document.writeln(' readonly98269 = ( price98269 * (rate98269/100) ) - delivery98269;'); document.writeln(' royday98269 = numtitles98269 * readonly98269 * numday98269;'); document.writeln(' royyear98269 = royday98269 * 365;'); document.writeln(' roymonth98269 = royyear98269 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function Update7Values98269()'); document.writeln('{'); document.writeln('//rate98269-35-amazon-royalties-estimator'); document.writeln(' doc'+'ument.getElementById("readonly98269-amazon-royalties-estimator").innerHTML = ReturnCurrencyNumberCommaized98269(readonly98269,2);'); document.writeln(' doc'+'ument.getElementById("numday98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(numday98269,0);'); document.writeln(' doc'+'ument.getElementById("nummonth98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(nummonth98269,0);'); document.writeln(' doc'+'ument.getElementById("numyear98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(numyear98269,0);'); document.writeln(' doc'+'ument.getElementById("royday98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(royday98269,2);'); document.writeln(' doc'+'ument.getElementById("roymonth98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(roymonth98269,2);'); document.writeln(' doc'+'ument.getElementById("royyear98269-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized98269(royyear98269,2);'); document.writeln('}'); document.writeln(''); document.writeln('function ReturnCurrencyNumber98269(n,d) { return n.toFixed(d); }'); document.writeln(''); document.writeln('function ReturnCurrencyNumberCommaized98269(n,d)'); document.writeln('{'); document.writeln(' var number = ReturnCurrencyNumber98269(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('');