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 numtitles71872, price71872, rate71872, delivery71872, latestdelivery71872, readonly71872, numday71872, nummonth71872, numyear71872, royday71872, roymonth71872, royyear71872;'); document.writeln('InitialSetup71872();'); document.writeln(''); document.writeln('function InitialSetup71872()'); document.writeln('{'); document.writeln(' numtitles71872 = 3;'); document.writeln(' price71872 = 2.99;'); document.writeln(' delivery71872 = latestdelivery71872 = 0.06;'); document.writeln(' numday71872 = 10;'); document.writeln(' rate71872 = 0;'); document.writeln(' if( price71872 >= 2.99 && price71872 <= 9.99 )'); document.writeln(' {'); document.writeln(' rate71872 = 70;'); document.writeln(' doc'+'ument.getElementById("rate71872-35-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate71872-70-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate71872-amazon-royalties-estimator").value = 70;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' rate71872 = 35;'); document.writeln(' doc'+'ument.getElementById("rate71872-35-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate71872-70-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate71872-amazon-royalties-estimator").value = 35;'); document.writeln(' }'); document.writeln(' doc'+'ument.getElementById("numtitles71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(numtitles71872,0);'); document.writeln(' doc'+'ument.getElementById("price71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(price71872,2);'); document.writeln(' doc'+'ument.getElementById("delivery71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(delivery71872,2);'); document.writeln(' doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(numday71872,2);'); document.writeln(' FinishCalculation71872();'); document.writeln('}'); document.writeln(''); document.writeln('function UpdateAll71872()'); document.writeln('{'); document.writeln(' numtitles71872 = doc'+'ument.getElementById("numtitles71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numtitles71872 = parseInt(numtitles71872);'); document.writeln(' doc'+'ument.getElementById("numtitles71872-amazon-royalties-estimator").value = numtitles71872;'); document.writeln('// numtitles71872 = parseInt(doc'+'ument.getElementById("numtitles71872-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numtitles71872) )'); document.writeln(' {'); document.writeln(' numtitles71872 = 0;'); document.writeln(' doc'+'ument.getElementById("numtitles71872-amazon-royalties-estimator").value = numtitles71872;'); document.writeln(' }'); document.writeln(' price71872 = doc'+'ument.getElementById("price71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' price71872 = parseFloat(price71872);'); document.writeln(' doc'+'ument.getElementById("price71872-amazon-royalties-estimator").value = price71872;'); document.writeln('// price71872 = parseFloat(doc'+'ument.getElementById("price71872-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(price71872) )'); document.writeln(' {'); document.writeln(' price71872 = \'0.0\';'); document.writeln(' doc'+'ument.getElementById("price71872-amazon-royalties-estimator").value = price71872;'); document.writeln(' }'); document.writeln(' rate71872 = doc'+'ument.getElementById("rate71872-70-amazon-royalties-estimator").checked ? 70 : 35;'); document.writeln(' doc'+'ument.getElementById("rate71872-amazon-royalties-estimator").value = rate71872;'); document.writeln(' delivery71872 = doc'+'ument.getElementById("delivery71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' delivery71872 = parseFloat(delivery71872);'); document.writeln(' doc'+'ument.getElementById("delivery71872-amazon-royalties-estimator").value = delivery71872;'); document.writeln('// delivery71872 = parseFloat(doc'+'ument.getElementById("delivery71872-amazon-royalties-estimator").value);'); document.writeln(' doc'+'ument.getElementById("delivery71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872( parseFloat(doc'+'ument.getElementById("delivery71872-amazon-royalties-estimator").value), 2 );'); document.writeln(' if( rate71872 < 70 )'); document.writeln(' {'); document.writeln(' if( delivery71872 > 0 ) { latestdelivery71872 = delivery71872; }'); document.writeln(' doc'+'ument.getElementById("delivery71872-amazon-royalties-estimator").value = \'0.00\';'); document.writeln(' delivery71872 = 0.0;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' if( delivery71872 <= 0 && latestdelivery71872 > 0 )'); document.writeln(' {'); document.writeln(' delivery71872 = latestdelivery71872;'); document.writeln(' doc'+'ument.getElementById("delivery71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(delivery71872,2);'); document.writeln(' }'); document.writeln(' }'); document.writeln(''); document.writeln(' if( isNaN(delivery71872) )'); document.writeln(' {'); document.writeln(' delivery71872 = \'0.00\';'); document.writeln(' doc'+'ument.getElementById("delivery71872-amazon-royalties-estimator").value = delivery71872;'); document.writeln(' }'); document.writeln(' readonly71872 = ( numday71872 * (rate71872/100) ) - delivery71872;'); document.writeln(' numday71872 = doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday71872 = parseInt(numday71872);'); document.writeln(' doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value = numday71872;'); document.writeln('// numday71872 = parseInt(doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday71872) )'); document.writeln(' {'); document.writeln(' numday71872 = 0;'); document.writeln(' doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value = numday71872;'); document.writeln(' }'); document.writeln(' FinishCalculation71872();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerDay71872()'); document.writeln('{'); document.writeln(' numday71872 = doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday71872 = parseInt(numday71872);'); document.writeln(' doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value = numday71872;'); document.writeln('// numday71872 = parseInt(doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday71872) ) { numday71872 = 0; }'); document.writeln(' DetermineNumberSoldPerPeriods71872();'); document.writeln(' CalculateRoyaltyNumbers71872();'); document.writeln(' Update7Values71872();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerMonth71872()'); document.writeln('{'); document.writeln(' nummonth71872 = doc'+'ument.getElementById("nummonth71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' nummonth71872 = parseInt(nummonth71872);'); document.writeln(' doc'+'ument.getElementById("nummonth71872-amazon-royalties-estimator").value = nummonth71872;'); document.writeln('// nummonth71872 = parseInt(doc'+'ument.getElementById("nummonth71872-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(nummonth71872) ) { nummonth71872 = 0; }'); document.writeln(' numyear71872 = nummonth71872 * 12;'); document.writeln(' numday71872 = numyear71872 / 365;'); document.writeln(' doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value = numday71872;'); document.writeln(' doc'+'ument.getElementById("nummonth71872-amazon-royalties-estimator").value = nummonth71872;'); document.writeln(' doc'+'ument.getElementById("numyear71872-amazon-royalties-estimator").value = numyear71872;'); document.writeln(' CalculateRoyaltyNumbers71872();'); document.writeln(' Update7Values71872();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerYear71872()'); document.writeln('{'); document.writeln(' numyear71872 = doc'+'ument.getElementById("numyear71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numyear71872 = parseInt(numyear71872);'); document.writeln(' doc'+'ument.getElementById("numyear71872-amazon-royalties-estimator").value = numyear71872;'); document.writeln('// numyear71872 = parseInt(doc'+'ument.getElementById("numyear71872-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numyear71872) ) { numyear71872 = 0; }'); document.writeln(' numday71872 = numyear71872 / 365;'); document.writeln(' nummonth71872 = numyear71872 / 12;'); document.writeln(' doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value = numday71872;'); document.writeln(' doc'+'ument.getElementById("nummonth71872-amazon-royalties-estimator").value = nummonth71872;'); document.writeln(' doc'+'ument.getElementById("numyear71872-amazon-royalties-estimator").value = numyear71872;'); document.writeln(' CalculateRoyaltyNumbers71872();'); document.writeln(' Update7Values71872();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerDay71872()'); document.writeln('{'); document.writeln(' royday71872 = doc'+'ument.getElementById("royday71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royday71872 = parseFloat(royday71872);'); document.writeln(' doc'+'ument.getElementById("royday71872-amazon-royalties-estimator").value = royday71872;'); document.writeln('// royday71872 = parseFloat(doc'+'ument.getElementById("royday71872-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royday71872) ) { royday71872 = 0; }'); document.writeln(' royyear71872 = royday71872 * 365;'); document.writeln(' roymonth71872 = royyear71872 / 12;'); document.writeln(' numday71872 = royday71872 / (readonly71872 * numtitles71872);'); document.writeln(' DetermineNumberSoldPerPeriods71872()'); document.writeln(' Update7Values71872();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerMonth71872()'); document.writeln('{'); document.writeln(' roymonth71872 = doc'+'ument.getElementById("roymonth71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' roymonth71872 = parseFloat(roymonth71872);'); document.writeln(' doc'+'ument.getElementById("roymonth71872-amazon-royalties-estimator").value = roymonth71872;'); document.writeln('// roymonth71872 = parseFloat(doc'+'ument.getElementById("roymonth71872-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(roymonth71872) ) { roymonth71872 = 0; }'); document.writeln(' royyear71872 = roymonth71872 * 12;'); document.writeln(' royday71872 = royyear71872 / 365;'); document.writeln(' numday71872 = royday71872 / (readonly71872 * numtitles71872);'); document.writeln(' DetermineNumberSoldPerPeriods71872()'); document.writeln(' Update7Values71872();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerYear71872()'); document.writeln('{'); document.writeln(' royyear71872 = doc'+'ument.getElementById("royyear71872-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royyear71872 = parseFloat(royyear71872);'); document.writeln(' doc'+'ument.getElementById("royyear71872-amazon-royalties-estimator").value = royyear71872;'); document.writeln('// royyear71872 = parseFloat(doc'+'ument.getElementById("royyear71872-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royyear71872) ) { royyear71872 = 0; }'); document.writeln(' royday71872 = royyear71872 / 365;'); document.writeln(' roymonth71872 = royyear71872 / 12;'); document.writeln(' numday71872 = royday71872 / (readonly71872 * numtitles71872);'); document.writeln(' DetermineNumberSoldPerPeriods71872()'); document.writeln(' Update7Values71872();'); document.writeln('}'); document.writeln(''); document.writeln('function DetermineNumberSoldPerPeriods71872()'); document.writeln('{'); document.writeln(' numyear71872 = numday71872 * 365;'); document.writeln(' nummonth71872 = numyear71872 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function FinishCalculation71872()'); document.writeln('{'); document.writeln(' Calculate6Numbers71872();'); document.writeln(' Update7Values71872();'); document.writeln('}'); document.writeln(''); document.writeln('function Calculate6Numbers71872()'); document.writeln('{'); document.writeln(' // numday71872 is assumed to be have the correct value.'); document.writeln(' readonly71872 = ( price71872 * (rate71872/100) ) - delivery71872;'); document.writeln(' DetermineNumberSoldPerPeriods71872();'); document.writeln(' royday71872 = numtitles71872 * readonly71872 * numday71872;'); document.writeln(' royyear71872 = royday71872 * 365;'); document.writeln(' roymonth71872 = royyear71872 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function CalculateRoyaltyNumbers71872()'); document.writeln('{'); document.writeln(' // numday71872 is assumed to be have the correct value.'); document.writeln(' readonly71872 = ( price71872 * (rate71872/100) ) - delivery71872;'); document.writeln(' royday71872 = numtitles71872 * readonly71872 * numday71872;'); document.writeln(' royyear71872 = royday71872 * 365;'); document.writeln(' roymonth71872 = royyear71872 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function Update7Values71872()'); document.writeln('{'); document.writeln('//rate71872-35-amazon-royalties-estimator'); document.writeln(' doc'+'ument.getElementById("readonly71872-amazon-royalties-estimator").innerHTML = ReturnCurrencyNumberCommaized71872(readonly71872,2);'); document.writeln(' doc'+'ument.getElementById("numday71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(numday71872,0);'); document.writeln(' doc'+'ument.getElementById("nummonth71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(nummonth71872,0);'); document.writeln(' doc'+'ument.getElementById("numyear71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(numyear71872,0);'); document.writeln(' doc'+'ument.getElementById("royday71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(royday71872,2);'); document.writeln(' doc'+'ument.getElementById("roymonth71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(roymonth71872,2);'); document.writeln(' doc'+'ument.getElementById("royyear71872-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized71872(royyear71872,2);'); document.writeln('}'); document.writeln(''); document.writeln('function ReturnCurrencyNumber71872(n,d) { return n.toFixed(d); }'); document.writeln(''); document.writeln('function ReturnCurrencyNumberCommaized71872(n,d)'); document.writeln('{'); document.writeln(' var number = ReturnCurrencyNumber71872(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('');