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 numtitles79934, price79934, rate79934, delivery79934, latestdelivery79934, readonly79934, numday79934, nummonth79934, numyear79934, royday79934, roymonth79934, royyear79934;'); document.writeln('InitialSetup79934();'); document.writeln(''); document.writeln('function InitialSetup79934()'); document.writeln('{'); document.writeln(' numtitles79934 = 3;'); document.writeln(' price79934 = 2.99;'); document.writeln(' delivery79934 = latestdelivery79934 = 0.06;'); document.writeln(' numday79934 = 10;'); document.writeln(' rate79934 = 0;'); document.writeln(' if( price79934 >= 2.99 && price79934 <= 9.99 )'); document.writeln(' {'); document.writeln(' rate79934 = 70;'); document.writeln(' doc'+'ument.getElementById("rate79934-35-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate79934-70-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate79934-amazon-royalties-estimator").value = 70;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' rate79934 = 35;'); document.writeln(' doc'+'ument.getElementById("rate79934-35-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate79934-70-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate79934-amazon-royalties-estimator").value = 35;'); document.writeln(' }'); document.writeln(' doc'+'ument.getElementById("numtitles79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(numtitles79934,0);'); document.writeln(' doc'+'ument.getElementById("price79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(price79934,2);'); document.writeln(' doc'+'ument.getElementById("delivery79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(delivery79934,2);'); document.writeln(' doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(numday79934,2);'); document.writeln(' FinishCalculation79934();'); document.writeln('}'); document.writeln(''); document.writeln('function UpdateAll79934()'); document.writeln('{'); document.writeln(' numtitles79934 = doc'+'ument.getElementById("numtitles79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numtitles79934 = parseInt(numtitles79934);'); document.writeln(' doc'+'ument.getElementById("numtitles79934-amazon-royalties-estimator").value = numtitles79934;'); document.writeln('// numtitles79934 = parseInt(doc'+'ument.getElementById("numtitles79934-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numtitles79934) )'); document.writeln(' {'); document.writeln(' numtitles79934 = 0;'); document.writeln(' doc'+'ument.getElementById("numtitles79934-amazon-royalties-estimator").value = numtitles79934;'); document.writeln(' }'); document.writeln(' price79934 = doc'+'ument.getElementById("price79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' price79934 = parseFloat(price79934);'); document.writeln(' doc'+'ument.getElementById("price79934-amazon-royalties-estimator").value = price79934;'); document.writeln('// price79934 = parseFloat(doc'+'ument.getElementById("price79934-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(price79934) )'); document.writeln(' {'); document.writeln(' price79934 = \'0.0\';'); document.writeln(' doc'+'ument.getElementById("price79934-amazon-royalties-estimator").value = price79934;'); document.writeln(' }'); document.writeln(' rate79934 = doc'+'ument.getElementById("rate79934-70-amazon-royalties-estimator").checked ? 70 : 35;'); document.writeln(' doc'+'ument.getElementById("rate79934-amazon-royalties-estimator").value = rate79934;'); document.writeln(' delivery79934 = doc'+'ument.getElementById("delivery79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' delivery79934 = parseFloat(delivery79934);'); document.writeln(' doc'+'ument.getElementById("delivery79934-amazon-royalties-estimator").value = delivery79934;'); document.writeln('// delivery79934 = parseFloat(doc'+'ument.getElementById("delivery79934-amazon-royalties-estimator").value);'); document.writeln(' doc'+'ument.getElementById("delivery79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934( parseFloat(doc'+'ument.getElementById("delivery79934-amazon-royalties-estimator").value), 2 );'); document.writeln(' if( rate79934 < 70 )'); document.writeln(' {'); document.writeln(' if( delivery79934 > 0 ) { latestdelivery79934 = delivery79934; }'); document.writeln(' doc'+'ument.getElementById("delivery79934-amazon-royalties-estimator").value = \'0.00\';'); document.writeln(' delivery79934 = 0.0;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' if( delivery79934 <= 0 && latestdelivery79934 > 0 )'); document.writeln(' {'); document.writeln(' delivery79934 = latestdelivery79934;'); document.writeln(' doc'+'ument.getElementById("delivery79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(delivery79934,2);'); document.writeln(' }'); document.writeln(' }'); document.writeln(''); document.writeln(' if( isNaN(delivery79934) )'); document.writeln(' {'); document.writeln(' delivery79934 = \'0.00\';'); document.writeln(' doc'+'ument.getElementById("delivery79934-amazon-royalties-estimator").value = delivery79934;'); document.writeln(' }'); document.writeln(' readonly79934 = ( numday79934 * (rate79934/100) ) - delivery79934;'); document.writeln(' numday79934 = doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday79934 = parseInt(numday79934);'); document.writeln(' doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value = numday79934;'); document.writeln('// numday79934 = parseInt(doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday79934) )'); document.writeln(' {'); document.writeln(' numday79934 = 0;'); document.writeln(' doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value = numday79934;'); document.writeln(' }'); document.writeln(' FinishCalculation79934();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerDay79934()'); document.writeln('{'); document.writeln(' numday79934 = doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday79934 = parseInt(numday79934);'); document.writeln(' doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value = numday79934;'); document.writeln('// numday79934 = parseInt(doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday79934) ) { numday79934 = 0; }'); document.writeln(' DetermineNumberSoldPerPeriods79934();'); document.writeln(' CalculateRoyaltyNumbers79934();'); document.writeln(' Update7Values79934();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerMonth79934()'); document.writeln('{'); document.writeln(' nummonth79934 = doc'+'ument.getElementById("nummonth79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' nummonth79934 = parseInt(nummonth79934);'); document.writeln(' doc'+'ument.getElementById("nummonth79934-amazon-royalties-estimator").value = nummonth79934;'); document.writeln('// nummonth79934 = parseInt(doc'+'ument.getElementById("nummonth79934-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(nummonth79934) ) { nummonth79934 = 0; }'); document.writeln(' numyear79934 = nummonth79934 * 12;'); document.writeln(' numday79934 = numyear79934 / 365;'); document.writeln(' doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value = numday79934;'); document.writeln(' doc'+'ument.getElementById("nummonth79934-amazon-royalties-estimator").value = nummonth79934;'); document.writeln(' doc'+'ument.getElementById("numyear79934-amazon-royalties-estimator").value = numyear79934;'); document.writeln(' CalculateRoyaltyNumbers79934();'); document.writeln(' Update7Values79934();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerYear79934()'); document.writeln('{'); document.writeln(' numyear79934 = doc'+'ument.getElementById("numyear79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numyear79934 = parseInt(numyear79934);'); document.writeln(' doc'+'ument.getElementById("numyear79934-amazon-royalties-estimator").value = numyear79934;'); document.writeln('// numyear79934 = parseInt(doc'+'ument.getElementById("numyear79934-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numyear79934) ) { numyear79934 = 0; }'); document.writeln(' numday79934 = numyear79934 / 365;'); document.writeln(' nummonth79934 = numyear79934 / 12;'); document.writeln(' doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value = numday79934;'); document.writeln(' doc'+'ument.getElementById("nummonth79934-amazon-royalties-estimator").value = nummonth79934;'); document.writeln(' doc'+'ument.getElementById("numyear79934-amazon-royalties-estimator").value = numyear79934;'); document.writeln(' CalculateRoyaltyNumbers79934();'); document.writeln(' Update7Values79934();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerDay79934()'); document.writeln('{'); document.writeln(' royday79934 = doc'+'ument.getElementById("royday79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royday79934 = parseFloat(royday79934);'); document.writeln(' doc'+'ument.getElementById("royday79934-amazon-royalties-estimator").value = royday79934;'); document.writeln('// royday79934 = parseFloat(doc'+'ument.getElementById("royday79934-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royday79934) ) { royday79934 = 0; }'); document.writeln(' royyear79934 = royday79934 * 365;'); document.writeln(' roymonth79934 = royyear79934 / 12;'); document.writeln(' numday79934 = royday79934 / (readonly79934 * numtitles79934);'); document.writeln(' DetermineNumberSoldPerPeriods79934()'); document.writeln(' Update7Values79934();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerMonth79934()'); document.writeln('{'); document.writeln(' roymonth79934 = doc'+'ument.getElementById("roymonth79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' roymonth79934 = parseFloat(roymonth79934);'); document.writeln(' doc'+'ument.getElementById("roymonth79934-amazon-royalties-estimator").value = roymonth79934;'); document.writeln('// roymonth79934 = parseFloat(doc'+'ument.getElementById("roymonth79934-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(roymonth79934) ) { roymonth79934 = 0; }'); document.writeln(' royyear79934 = roymonth79934 * 12;'); document.writeln(' royday79934 = royyear79934 / 365;'); document.writeln(' numday79934 = royday79934 / (readonly79934 * numtitles79934);'); document.writeln(' DetermineNumberSoldPerPeriods79934()'); document.writeln(' Update7Values79934();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerYear79934()'); document.writeln('{'); document.writeln(' royyear79934 = doc'+'ument.getElementById("royyear79934-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royyear79934 = parseFloat(royyear79934);'); document.writeln(' doc'+'ument.getElementById("royyear79934-amazon-royalties-estimator").value = royyear79934;'); document.writeln('// royyear79934 = parseFloat(doc'+'ument.getElementById("royyear79934-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royyear79934) ) { royyear79934 = 0; }'); document.writeln(' royday79934 = royyear79934 / 365;'); document.writeln(' roymonth79934 = royyear79934 / 12;'); document.writeln(' numday79934 = royday79934 / (readonly79934 * numtitles79934);'); document.writeln(' DetermineNumberSoldPerPeriods79934()'); document.writeln(' Update7Values79934();'); document.writeln('}'); document.writeln(''); document.writeln('function DetermineNumberSoldPerPeriods79934()'); document.writeln('{'); document.writeln(' numyear79934 = numday79934 * 365;'); document.writeln(' nummonth79934 = numyear79934 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function FinishCalculation79934()'); document.writeln('{'); document.writeln(' Calculate6Numbers79934();'); document.writeln(' Update7Values79934();'); document.writeln('}'); document.writeln(''); document.writeln('function Calculate6Numbers79934()'); document.writeln('{'); document.writeln(' // numday79934 is assumed to be have the correct value.'); document.writeln(' readonly79934 = ( price79934 * (rate79934/100) ) - delivery79934;'); document.writeln(' DetermineNumberSoldPerPeriods79934();'); document.writeln(' royday79934 = numtitles79934 * readonly79934 * numday79934;'); document.writeln(' royyear79934 = royday79934 * 365;'); document.writeln(' roymonth79934 = royyear79934 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function CalculateRoyaltyNumbers79934()'); document.writeln('{'); document.writeln(' // numday79934 is assumed to be have the correct value.'); document.writeln(' readonly79934 = ( price79934 * (rate79934/100) ) - delivery79934;'); document.writeln(' royday79934 = numtitles79934 * readonly79934 * numday79934;'); document.writeln(' royyear79934 = royday79934 * 365;'); document.writeln(' roymonth79934 = royyear79934 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function Update7Values79934()'); document.writeln('{'); document.writeln('//rate79934-35-amazon-royalties-estimator'); document.writeln(' doc'+'ument.getElementById("readonly79934-amazon-royalties-estimator").innerHTML = ReturnCurrencyNumberCommaized79934(readonly79934,2);'); document.writeln(' doc'+'ument.getElementById("numday79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(numday79934,0);'); document.writeln(' doc'+'ument.getElementById("nummonth79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(nummonth79934,0);'); document.writeln(' doc'+'ument.getElementById("numyear79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(numyear79934,0);'); document.writeln(' doc'+'ument.getElementById("royday79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(royday79934,2);'); document.writeln(' doc'+'ument.getElementById("roymonth79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(roymonth79934,2);'); document.writeln(' doc'+'ument.getElementById("royyear79934-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized79934(royyear79934,2);'); document.writeln('}'); document.writeln(''); document.writeln('function ReturnCurrencyNumber79934(n,d) { return n.toFixed(d); }'); document.writeln(''); document.writeln('function ReturnCurrencyNumberCommaized79934(n,d)'); document.writeln('{'); document.writeln(' var number = ReturnCurrencyNumber79934(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('');