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 numtitles70243, price70243, rate70243, delivery70243, latestdelivery70243, readonly70243, numday70243, nummonth70243, numyear70243, royday70243, roymonth70243, royyear70243;'); document.writeln('InitialSetup70243();'); document.writeln(''); document.writeln('function InitialSetup70243()'); document.writeln('{'); document.writeln(' numtitles70243 = 3;'); document.writeln(' price70243 = 2.99;'); document.writeln(' delivery70243 = latestdelivery70243 = 0.06;'); document.writeln(' numday70243 = 10;'); document.writeln(' rate70243 = 0;'); document.writeln(' if( price70243 >= 2.99 && price70243 <= 9.99 )'); document.writeln(' {'); document.writeln(' rate70243 = 70;'); document.writeln(' doc'+'ument.getElementById("rate70243-35-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate70243-70-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate70243-amazon-royalties-estimator").value = 70;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' rate70243 = 35;'); document.writeln(' doc'+'ument.getElementById("rate70243-35-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate70243-70-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate70243-amazon-royalties-estimator").value = 35;'); document.writeln(' }'); document.writeln(' doc'+'ument.getElementById("numtitles70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(numtitles70243,0);'); document.writeln(' doc'+'ument.getElementById("price70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(price70243,2);'); document.writeln(' doc'+'ument.getElementById("delivery70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(delivery70243,2);'); document.writeln(' doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(numday70243,2);'); document.writeln(' FinishCalculation70243();'); document.writeln('}'); document.writeln(''); document.writeln('function UpdateAll70243()'); document.writeln('{'); document.writeln(' numtitles70243 = doc'+'ument.getElementById("numtitles70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numtitles70243 = parseInt(numtitles70243);'); document.writeln(' doc'+'ument.getElementById("numtitles70243-amazon-royalties-estimator").value = numtitles70243;'); document.writeln('// numtitles70243 = parseInt(doc'+'ument.getElementById("numtitles70243-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numtitles70243) )'); document.writeln(' {'); document.writeln(' numtitles70243 = 0;'); document.writeln(' doc'+'ument.getElementById("numtitles70243-amazon-royalties-estimator").value = numtitles70243;'); document.writeln(' }'); document.writeln(' price70243 = doc'+'ument.getElementById("price70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' price70243 = parseFloat(price70243);'); document.writeln(' doc'+'ument.getElementById("price70243-amazon-royalties-estimator").value = price70243;'); document.writeln('// price70243 = parseFloat(doc'+'ument.getElementById("price70243-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(price70243) )'); document.writeln(' {'); document.writeln(' price70243 = \'0.0\';'); document.writeln(' doc'+'ument.getElementById("price70243-amazon-royalties-estimator").value = price70243;'); document.writeln(' }'); document.writeln(' rate70243 = doc'+'ument.getElementById("rate70243-70-amazon-royalties-estimator").checked ? 70 : 35;'); document.writeln(' doc'+'ument.getElementById("rate70243-amazon-royalties-estimator").value = rate70243;'); document.writeln(' delivery70243 = doc'+'ument.getElementById("delivery70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' delivery70243 = parseFloat(delivery70243);'); document.writeln(' doc'+'ument.getElementById("delivery70243-amazon-royalties-estimator").value = delivery70243;'); document.writeln('// delivery70243 = parseFloat(doc'+'ument.getElementById("delivery70243-amazon-royalties-estimator").value);'); document.writeln(' doc'+'ument.getElementById("delivery70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243( parseFloat(doc'+'ument.getElementById("delivery70243-amazon-royalties-estimator").value), 2 );'); document.writeln(' if( rate70243 < 70 )'); document.writeln(' {'); document.writeln(' if( delivery70243 > 0 ) { latestdelivery70243 = delivery70243; }'); document.writeln(' doc'+'ument.getElementById("delivery70243-amazon-royalties-estimator").value = \'0.00\';'); document.writeln(' delivery70243 = 0.0;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' if( delivery70243 <= 0 && latestdelivery70243 > 0 )'); document.writeln(' {'); document.writeln(' delivery70243 = latestdelivery70243;'); document.writeln(' doc'+'ument.getElementById("delivery70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(delivery70243,2);'); document.writeln(' }'); document.writeln(' }'); document.writeln(''); document.writeln(' if( isNaN(delivery70243) )'); document.writeln(' {'); document.writeln(' delivery70243 = \'0.00\';'); document.writeln(' doc'+'ument.getElementById("delivery70243-amazon-royalties-estimator").value = delivery70243;'); document.writeln(' }'); document.writeln(' readonly70243 = ( numday70243 * (rate70243/100) ) - delivery70243;'); document.writeln(' numday70243 = doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday70243 = parseInt(numday70243);'); document.writeln(' doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value = numday70243;'); document.writeln('// numday70243 = parseInt(doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday70243) )'); document.writeln(' {'); document.writeln(' numday70243 = 0;'); document.writeln(' doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value = numday70243;'); document.writeln(' }'); document.writeln(' FinishCalculation70243();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerDay70243()'); document.writeln('{'); document.writeln(' numday70243 = doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday70243 = parseInt(numday70243);'); document.writeln(' doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value = numday70243;'); document.writeln('// numday70243 = parseInt(doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday70243) ) { numday70243 = 0; }'); document.writeln(' DetermineNumberSoldPerPeriods70243();'); document.writeln(' CalculateRoyaltyNumbers70243();'); document.writeln(' Update7Values70243();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerMonth70243()'); document.writeln('{'); document.writeln(' nummonth70243 = doc'+'ument.getElementById("nummonth70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' nummonth70243 = parseInt(nummonth70243);'); document.writeln(' doc'+'ument.getElementById("nummonth70243-amazon-royalties-estimator").value = nummonth70243;'); document.writeln('// nummonth70243 = parseInt(doc'+'ument.getElementById("nummonth70243-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(nummonth70243) ) { nummonth70243 = 0; }'); document.writeln(' numyear70243 = nummonth70243 * 12;'); document.writeln(' numday70243 = numyear70243 / 365;'); document.writeln(' doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value = numday70243;'); document.writeln(' doc'+'ument.getElementById("nummonth70243-amazon-royalties-estimator").value = nummonth70243;'); document.writeln(' doc'+'ument.getElementById("numyear70243-amazon-royalties-estimator").value = numyear70243;'); document.writeln(' CalculateRoyaltyNumbers70243();'); document.writeln(' Update7Values70243();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerYear70243()'); document.writeln('{'); document.writeln(' numyear70243 = doc'+'ument.getElementById("numyear70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numyear70243 = parseInt(numyear70243);'); document.writeln(' doc'+'ument.getElementById("numyear70243-amazon-royalties-estimator").value = numyear70243;'); document.writeln('// numyear70243 = parseInt(doc'+'ument.getElementById("numyear70243-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numyear70243) ) { numyear70243 = 0; }'); document.writeln(' numday70243 = numyear70243 / 365;'); document.writeln(' nummonth70243 = numyear70243 / 12;'); document.writeln(' doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value = numday70243;'); document.writeln(' doc'+'ument.getElementById("nummonth70243-amazon-royalties-estimator").value = nummonth70243;'); document.writeln(' doc'+'ument.getElementById("numyear70243-amazon-royalties-estimator").value = numyear70243;'); document.writeln(' CalculateRoyaltyNumbers70243();'); document.writeln(' Update7Values70243();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerDay70243()'); document.writeln('{'); document.writeln(' royday70243 = doc'+'ument.getElementById("royday70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royday70243 = parseFloat(royday70243);'); document.writeln(' doc'+'ument.getElementById("royday70243-amazon-royalties-estimator").value = royday70243;'); document.writeln('// royday70243 = parseFloat(doc'+'ument.getElementById("royday70243-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royday70243) ) { royday70243 = 0; }'); document.writeln(' royyear70243 = royday70243 * 365;'); document.writeln(' roymonth70243 = royyear70243 / 12;'); document.writeln(' numday70243 = royday70243 / (readonly70243 * numtitles70243);'); document.writeln(' DetermineNumberSoldPerPeriods70243()'); document.writeln(' Update7Values70243();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerMonth70243()'); document.writeln('{'); document.writeln(' roymonth70243 = doc'+'ument.getElementById("roymonth70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' roymonth70243 = parseFloat(roymonth70243);'); document.writeln(' doc'+'ument.getElementById("roymonth70243-amazon-royalties-estimator").value = roymonth70243;'); document.writeln('// roymonth70243 = parseFloat(doc'+'ument.getElementById("roymonth70243-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(roymonth70243) ) { roymonth70243 = 0; }'); document.writeln(' royyear70243 = roymonth70243 * 12;'); document.writeln(' royday70243 = royyear70243 / 365;'); document.writeln(' numday70243 = royday70243 / (readonly70243 * numtitles70243);'); document.writeln(' DetermineNumberSoldPerPeriods70243()'); document.writeln(' Update7Values70243();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerYear70243()'); document.writeln('{'); document.writeln(' royyear70243 = doc'+'ument.getElementById("royyear70243-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royyear70243 = parseFloat(royyear70243);'); document.writeln(' doc'+'ument.getElementById("royyear70243-amazon-royalties-estimator").value = royyear70243;'); document.writeln('// royyear70243 = parseFloat(doc'+'ument.getElementById("royyear70243-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royyear70243) ) { royyear70243 = 0; }'); document.writeln(' royday70243 = royyear70243 / 365;'); document.writeln(' roymonth70243 = royyear70243 / 12;'); document.writeln(' numday70243 = royday70243 / (readonly70243 * numtitles70243);'); document.writeln(' DetermineNumberSoldPerPeriods70243()'); document.writeln(' Update7Values70243();'); document.writeln('}'); document.writeln(''); document.writeln('function DetermineNumberSoldPerPeriods70243()'); document.writeln('{'); document.writeln(' numyear70243 = numday70243 * 365;'); document.writeln(' nummonth70243 = numyear70243 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function FinishCalculation70243()'); document.writeln('{'); document.writeln(' Calculate6Numbers70243();'); document.writeln(' Update7Values70243();'); document.writeln('}'); document.writeln(''); document.writeln('function Calculate6Numbers70243()'); document.writeln('{'); document.writeln(' // numday70243 is assumed to be have the correct value.'); document.writeln(' readonly70243 = ( price70243 * (rate70243/100) ) - delivery70243;'); document.writeln(' DetermineNumberSoldPerPeriods70243();'); document.writeln(' royday70243 = numtitles70243 * readonly70243 * numday70243;'); document.writeln(' royyear70243 = royday70243 * 365;'); document.writeln(' roymonth70243 = royyear70243 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function CalculateRoyaltyNumbers70243()'); document.writeln('{'); document.writeln(' // numday70243 is assumed to be have the correct value.'); document.writeln(' readonly70243 = ( price70243 * (rate70243/100) ) - delivery70243;'); document.writeln(' royday70243 = numtitles70243 * readonly70243 * numday70243;'); document.writeln(' royyear70243 = royday70243 * 365;'); document.writeln(' roymonth70243 = royyear70243 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function Update7Values70243()'); document.writeln('{'); document.writeln('//rate70243-35-amazon-royalties-estimator'); document.writeln(' doc'+'ument.getElementById("readonly70243-amazon-royalties-estimator").innerHTML = ReturnCurrencyNumberCommaized70243(readonly70243,2);'); document.writeln(' doc'+'ument.getElementById("numday70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(numday70243,0);'); document.writeln(' doc'+'ument.getElementById("nummonth70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(nummonth70243,0);'); document.writeln(' doc'+'ument.getElementById("numyear70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(numyear70243,0);'); document.writeln(' doc'+'ument.getElementById("royday70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(royday70243,2);'); document.writeln(' doc'+'ument.getElementById("roymonth70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(roymonth70243,2);'); document.writeln(' doc'+'ument.getElementById("royyear70243-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized70243(royyear70243,2);'); document.writeln('}'); document.writeln(''); document.writeln('function ReturnCurrencyNumber70243(n,d) { return n.toFixed(d); }'); document.writeln(''); document.writeln('function ReturnCurrencyNumberCommaized70243(n,d)'); document.writeln('{'); document.writeln(' var number = ReturnCurrencyNumber70243(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('');