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 numtitles18080, price18080, rate18080, delivery18080, latestdelivery18080, readonly18080, numday18080, nummonth18080, numyear18080, royday18080, roymonth18080, royyear18080;'); document.writeln('InitialSetup18080();'); document.writeln(''); document.writeln('function InitialSetup18080()'); document.writeln('{'); document.writeln(' numtitles18080 = 3;'); document.writeln(' price18080 = 2.99;'); document.writeln(' delivery18080 = latestdelivery18080 = 0.06;'); document.writeln(' numday18080 = 10;'); document.writeln(' rate18080 = 0;'); document.writeln(' if( price18080 >= 2.99 && price18080 <= 9.99 )'); document.writeln(' {'); document.writeln(' rate18080 = 70;'); document.writeln(' doc'+'ument.getElementById("rate18080-35-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate18080-70-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate18080-amazon-royalties-estimator").value = 70;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' rate18080 = 35;'); document.writeln(' doc'+'ument.getElementById("rate18080-35-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate18080-70-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate18080-amazon-royalties-estimator").value = 35;'); document.writeln(' }'); document.writeln(' doc'+'ument.getElementById("numtitles18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(numtitles18080,0);'); document.writeln(' doc'+'ument.getElementById("price18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(price18080,2);'); document.writeln(' doc'+'ument.getElementById("delivery18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(delivery18080,2);'); document.writeln(' doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(numday18080,2);'); document.writeln(' FinishCalculation18080();'); document.writeln('}'); document.writeln(''); document.writeln('function UpdateAll18080()'); document.writeln('{'); document.writeln(' numtitles18080 = doc'+'ument.getElementById("numtitles18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numtitles18080 = parseInt(numtitles18080);'); document.writeln(' doc'+'ument.getElementById("numtitles18080-amazon-royalties-estimator").value = numtitles18080;'); document.writeln('// numtitles18080 = parseInt(doc'+'ument.getElementById("numtitles18080-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numtitles18080) )'); document.writeln(' {'); document.writeln(' numtitles18080 = 0;'); document.writeln(' doc'+'ument.getElementById("numtitles18080-amazon-royalties-estimator").value = numtitles18080;'); document.writeln(' }'); document.writeln(' price18080 = doc'+'ument.getElementById("price18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' price18080 = parseFloat(price18080);'); document.writeln(' doc'+'ument.getElementById("price18080-amazon-royalties-estimator").value = price18080;'); document.writeln('// price18080 = parseFloat(doc'+'ument.getElementById("price18080-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(price18080) )'); document.writeln(' {'); document.writeln(' price18080 = \'0.0\';'); document.writeln(' doc'+'ument.getElementById("price18080-amazon-royalties-estimator").value = price18080;'); document.writeln(' }'); document.writeln(' rate18080 = doc'+'ument.getElementById("rate18080-70-amazon-royalties-estimator").checked ? 70 : 35;'); document.writeln(' doc'+'ument.getElementById("rate18080-amazon-royalties-estimator").value = rate18080;'); document.writeln(' delivery18080 = doc'+'ument.getElementById("delivery18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' delivery18080 = parseFloat(delivery18080);'); document.writeln(' doc'+'ument.getElementById("delivery18080-amazon-royalties-estimator").value = delivery18080;'); document.writeln('// delivery18080 = parseFloat(doc'+'ument.getElementById("delivery18080-amazon-royalties-estimator").value);'); document.writeln(' doc'+'ument.getElementById("delivery18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080( parseFloat(doc'+'ument.getElementById("delivery18080-amazon-royalties-estimator").value), 2 );'); document.writeln(' if( rate18080 < 70 )'); document.writeln(' {'); document.writeln(' if( delivery18080 > 0 ) { latestdelivery18080 = delivery18080; }'); document.writeln(' doc'+'ument.getElementById("delivery18080-amazon-royalties-estimator").value = \'0.00\';'); document.writeln(' delivery18080 = 0.0;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' if( delivery18080 <= 0 && latestdelivery18080 > 0 )'); document.writeln(' {'); document.writeln(' delivery18080 = latestdelivery18080;'); document.writeln(' doc'+'ument.getElementById("delivery18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(delivery18080,2);'); document.writeln(' }'); document.writeln(' }'); document.writeln(''); document.writeln(' if( isNaN(delivery18080) )'); document.writeln(' {'); document.writeln(' delivery18080 = \'0.00\';'); document.writeln(' doc'+'ument.getElementById("delivery18080-amazon-royalties-estimator").value = delivery18080;'); document.writeln(' }'); document.writeln(' readonly18080 = ( numday18080 * (rate18080/100) ) - delivery18080;'); document.writeln(' numday18080 = doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday18080 = parseInt(numday18080);'); document.writeln(' doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value = numday18080;'); document.writeln('// numday18080 = parseInt(doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday18080) )'); document.writeln(' {'); document.writeln(' numday18080 = 0;'); document.writeln(' doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value = numday18080;'); document.writeln(' }'); document.writeln(' FinishCalculation18080();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerDay18080()'); document.writeln('{'); document.writeln(' numday18080 = doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday18080 = parseInt(numday18080);'); document.writeln(' doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value = numday18080;'); document.writeln('// numday18080 = parseInt(doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday18080) ) { numday18080 = 0; }'); document.writeln(' DetermineNumberSoldPerPeriods18080();'); document.writeln(' CalculateRoyaltyNumbers18080();'); document.writeln(' Update7Values18080();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerMonth18080()'); document.writeln('{'); document.writeln(' nummonth18080 = doc'+'ument.getElementById("nummonth18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' nummonth18080 = parseInt(nummonth18080);'); document.writeln(' doc'+'ument.getElementById("nummonth18080-amazon-royalties-estimator").value = nummonth18080;'); document.writeln('// nummonth18080 = parseInt(doc'+'ument.getElementById("nummonth18080-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(nummonth18080) ) { nummonth18080 = 0; }'); document.writeln(' numyear18080 = nummonth18080 * 12;'); document.writeln(' numday18080 = numyear18080 / 365;'); document.writeln(' doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value = numday18080;'); document.writeln(' doc'+'ument.getElementById("nummonth18080-amazon-royalties-estimator").value = nummonth18080;'); document.writeln(' doc'+'ument.getElementById("numyear18080-amazon-royalties-estimator").value = numyear18080;'); document.writeln(' CalculateRoyaltyNumbers18080();'); document.writeln(' Update7Values18080();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerYear18080()'); document.writeln('{'); document.writeln(' numyear18080 = doc'+'ument.getElementById("numyear18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numyear18080 = parseInt(numyear18080);'); document.writeln(' doc'+'ument.getElementById("numyear18080-amazon-royalties-estimator").value = numyear18080;'); document.writeln('// numyear18080 = parseInt(doc'+'ument.getElementById("numyear18080-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numyear18080) ) { numyear18080 = 0; }'); document.writeln(' numday18080 = numyear18080 / 365;'); document.writeln(' nummonth18080 = numyear18080 / 12;'); document.writeln(' doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value = numday18080;'); document.writeln(' doc'+'ument.getElementById("nummonth18080-amazon-royalties-estimator").value = nummonth18080;'); document.writeln(' doc'+'ument.getElementById("numyear18080-amazon-royalties-estimator").value = numyear18080;'); document.writeln(' CalculateRoyaltyNumbers18080();'); document.writeln(' Update7Values18080();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerDay18080()'); document.writeln('{'); document.writeln(' royday18080 = doc'+'ument.getElementById("royday18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royday18080 = parseFloat(royday18080);'); document.writeln(' doc'+'ument.getElementById("royday18080-amazon-royalties-estimator").value = royday18080;'); document.writeln('// royday18080 = parseFloat(doc'+'ument.getElementById("royday18080-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royday18080) ) { royday18080 = 0; }'); document.writeln(' royyear18080 = royday18080 * 365;'); document.writeln(' roymonth18080 = royyear18080 / 12;'); document.writeln(' numday18080 = royday18080 / (readonly18080 * numtitles18080);'); document.writeln(' DetermineNumberSoldPerPeriods18080()'); document.writeln(' Update7Values18080();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerMonth18080()'); document.writeln('{'); document.writeln(' roymonth18080 = doc'+'ument.getElementById("roymonth18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' roymonth18080 = parseFloat(roymonth18080);'); document.writeln(' doc'+'ument.getElementById("roymonth18080-amazon-royalties-estimator").value = roymonth18080;'); document.writeln('// roymonth18080 = parseFloat(doc'+'ument.getElementById("roymonth18080-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(roymonth18080) ) { roymonth18080 = 0; }'); document.writeln(' royyear18080 = roymonth18080 * 12;'); document.writeln(' royday18080 = royyear18080 / 365;'); document.writeln(' numday18080 = royday18080 / (readonly18080 * numtitles18080);'); document.writeln(' DetermineNumberSoldPerPeriods18080()'); document.writeln(' Update7Values18080();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerYear18080()'); document.writeln('{'); document.writeln(' royyear18080 = doc'+'ument.getElementById("royyear18080-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royyear18080 = parseFloat(royyear18080);'); document.writeln(' doc'+'ument.getElementById("royyear18080-amazon-royalties-estimator").value = royyear18080;'); document.writeln('// royyear18080 = parseFloat(doc'+'ument.getElementById("royyear18080-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royyear18080) ) { royyear18080 = 0; }'); document.writeln(' royday18080 = royyear18080 / 365;'); document.writeln(' roymonth18080 = royyear18080 / 12;'); document.writeln(' numday18080 = royday18080 / (readonly18080 * numtitles18080);'); document.writeln(' DetermineNumberSoldPerPeriods18080()'); document.writeln(' Update7Values18080();'); document.writeln('}'); document.writeln(''); document.writeln('function DetermineNumberSoldPerPeriods18080()'); document.writeln('{'); document.writeln(' numyear18080 = numday18080 * 365;'); document.writeln(' nummonth18080 = numyear18080 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function FinishCalculation18080()'); document.writeln('{'); document.writeln(' Calculate6Numbers18080();'); document.writeln(' Update7Values18080();'); document.writeln('}'); document.writeln(''); document.writeln('function Calculate6Numbers18080()'); document.writeln('{'); document.writeln(' // numday18080 is assumed to be have the correct value.'); document.writeln(' readonly18080 = ( price18080 * (rate18080/100) ) - delivery18080;'); document.writeln(' DetermineNumberSoldPerPeriods18080();'); document.writeln(' royday18080 = numtitles18080 * readonly18080 * numday18080;'); document.writeln(' royyear18080 = royday18080 * 365;'); document.writeln(' roymonth18080 = royyear18080 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function CalculateRoyaltyNumbers18080()'); document.writeln('{'); document.writeln(' // numday18080 is assumed to be have the correct value.'); document.writeln(' readonly18080 = ( price18080 * (rate18080/100) ) - delivery18080;'); document.writeln(' royday18080 = numtitles18080 * readonly18080 * numday18080;'); document.writeln(' royyear18080 = royday18080 * 365;'); document.writeln(' roymonth18080 = royyear18080 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function Update7Values18080()'); document.writeln('{'); document.writeln('//rate18080-35-amazon-royalties-estimator'); document.writeln(' doc'+'ument.getElementById("readonly18080-amazon-royalties-estimator").innerHTML = ReturnCurrencyNumberCommaized18080(readonly18080,2);'); document.writeln(' doc'+'ument.getElementById("numday18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(numday18080,0);'); document.writeln(' doc'+'ument.getElementById("nummonth18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(nummonth18080,0);'); document.writeln(' doc'+'ument.getElementById("numyear18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(numyear18080,0);'); document.writeln(' doc'+'ument.getElementById("royday18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(royday18080,2);'); document.writeln(' doc'+'ument.getElementById("roymonth18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(roymonth18080,2);'); document.writeln(' doc'+'ument.getElementById("royyear18080-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized18080(royyear18080,2);'); document.writeln('}'); document.writeln(''); document.writeln('function ReturnCurrencyNumber18080(n,d) { return n.toFixed(d); }'); document.writeln(''); document.writeln('function ReturnCurrencyNumberCommaized18080(n,d)'); document.writeln('{'); document.writeln(' var number = ReturnCurrencyNumber18080(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('');