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 numtitles12187, price12187, rate12187, delivery12187, latestdelivery12187, readonly12187, numday12187, nummonth12187, numyear12187, royday12187, roymonth12187, royyear12187;'); document.writeln('InitialSetup12187();'); document.writeln(''); document.writeln('function InitialSetup12187()'); document.writeln('{'); document.writeln(' numtitles12187 = 3;'); document.writeln(' price12187 = 2.99;'); document.writeln(' delivery12187 = latestdelivery12187 = 0.06;'); document.writeln(' numday12187 = 10;'); document.writeln(' rate12187 = 0;'); document.writeln(' if( price12187 >= 2.99 && price12187 <= 9.99 )'); document.writeln(' {'); document.writeln(' rate12187 = 70;'); document.writeln(' doc'+'ument.getElementById("rate12187-35-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate12187-70-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate12187-amazon-royalties-estimator").value = 70;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' rate12187 = 35;'); document.writeln(' doc'+'ument.getElementById("rate12187-35-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate12187-70-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate12187-amazon-royalties-estimator").value = 35;'); document.writeln(' }'); document.writeln(' doc'+'ument.getElementById("numtitles12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(numtitles12187,0);'); document.writeln(' doc'+'ument.getElementById("price12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(price12187,2);'); document.writeln(' doc'+'ument.getElementById("delivery12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(delivery12187,2);'); document.writeln(' doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(numday12187,2);'); document.writeln(' FinishCalculation12187();'); document.writeln('}'); document.writeln(''); document.writeln('function UpdateAll12187()'); document.writeln('{'); document.writeln(' numtitles12187 = doc'+'ument.getElementById("numtitles12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numtitles12187 = parseInt(numtitles12187);'); document.writeln(' doc'+'ument.getElementById("numtitles12187-amazon-royalties-estimator").value = numtitles12187;'); document.writeln('// numtitles12187 = parseInt(doc'+'ument.getElementById("numtitles12187-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numtitles12187) )'); document.writeln(' {'); document.writeln(' numtitles12187 = 0;'); document.writeln(' doc'+'ument.getElementById("numtitles12187-amazon-royalties-estimator").value = numtitles12187;'); document.writeln(' }'); document.writeln(' price12187 = doc'+'ument.getElementById("price12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' price12187 = parseFloat(price12187);'); document.writeln(' doc'+'ument.getElementById("price12187-amazon-royalties-estimator").value = price12187;'); document.writeln('// price12187 = parseFloat(doc'+'ument.getElementById("price12187-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(price12187) )'); document.writeln(' {'); document.writeln(' price12187 = \'0.0\';'); document.writeln(' doc'+'ument.getElementById("price12187-amazon-royalties-estimator").value = price12187;'); document.writeln(' }'); document.writeln(' rate12187 = doc'+'ument.getElementById("rate12187-70-amazon-royalties-estimator").checked ? 70 : 35;'); document.writeln(' doc'+'ument.getElementById("rate12187-amazon-royalties-estimator").value = rate12187;'); document.writeln(' delivery12187 = doc'+'ument.getElementById("delivery12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' delivery12187 = parseFloat(delivery12187);'); document.writeln(' doc'+'ument.getElementById("delivery12187-amazon-royalties-estimator").value = delivery12187;'); document.writeln('// delivery12187 = parseFloat(doc'+'ument.getElementById("delivery12187-amazon-royalties-estimator").value);'); document.writeln(' doc'+'ument.getElementById("delivery12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187( parseFloat(doc'+'ument.getElementById("delivery12187-amazon-royalties-estimator").value), 2 );'); document.writeln(' if( rate12187 < 70 )'); document.writeln(' {'); document.writeln(' if( delivery12187 > 0 ) { latestdelivery12187 = delivery12187; }'); document.writeln(' doc'+'ument.getElementById("delivery12187-amazon-royalties-estimator").value = \'0.00\';'); document.writeln(' delivery12187 = 0.0;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' if( delivery12187 <= 0 && latestdelivery12187 > 0 )'); document.writeln(' {'); document.writeln(' delivery12187 = latestdelivery12187;'); document.writeln(' doc'+'ument.getElementById("delivery12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(delivery12187,2);'); document.writeln(' }'); document.writeln(' }'); document.writeln(''); document.writeln(' if( isNaN(delivery12187) )'); document.writeln(' {'); document.writeln(' delivery12187 = \'0.00\';'); document.writeln(' doc'+'ument.getElementById("delivery12187-amazon-royalties-estimator").value = delivery12187;'); document.writeln(' }'); document.writeln(' readonly12187 = ( numday12187 * (rate12187/100) ) - delivery12187;'); document.writeln(' numday12187 = doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday12187 = parseInt(numday12187);'); document.writeln(' doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value = numday12187;'); document.writeln('// numday12187 = parseInt(doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday12187) )'); document.writeln(' {'); document.writeln(' numday12187 = 0;'); document.writeln(' doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value = numday12187;'); document.writeln(' }'); document.writeln(' FinishCalculation12187();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerDay12187()'); document.writeln('{'); document.writeln(' numday12187 = doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday12187 = parseInt(numday12187);'); document.writeln(' doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value = numday12187;'); document.writeln('// numday12187 = parseInt(doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday12187) ) { numday12187 = 0; }'); document.writeln(' DetermineNumberSoldPerPeriods12187();'); document.writeln(' CalculateRoyaltyNumbers12187();'); document.writeln(' Update7Values12187();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerMonth12187()'); document.writeln('{'); document.writeln(' nummonth12187 = doc'+'ument.getElementById("nummonth12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' nummonth12187 = parseInt(nummonth12187);'); document.writeln(' doc'+'ument.getElementById("nummonth12187-amazon-royalties-estimator").value = nummonth12187;'); document.writeln('// nummonth12187 = parseInt(doc'+'ument.getElementById("nummonth12187-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(nummonth12187) ) { nummonth12187 = 0; }'); document.writeln(' numyear12187 = nummonth12187 * 12;'); document.writeln(' numday12187 = numyear12187 / 365;'); document.writeln(' doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value = numday12187;'); document.writeln(' doc'+'ument.getElementById("nummonth12187-amazon-royalties-estimator").value = nummonth12187;'); document.writeln(' doc'+'ument.getElementById("numyear12187-amazon-royalties-estimator").value = numyear12187;'); document.writeln(' CalculateRoyaltyNumbers12187();'); document.writeln(' Update7Values12187();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerYear12187()'); document.writeln('{'); document.writeln(' numyear12187 = doc'+'ument.getElementById("numyear12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numyear12187 = parseInt(numyear12187);'); document.writeln(' doc'+'ument.getElementById("numyear12187-amazon-royalties-estimator").value = numyear12187;'); document.writeln('// numyear12187 = parseInt(doc'+'ument.getElementById("numyear12187-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numyear12187) ) { numyear12187 = 0; }'); document.writeln(' numday12187 = numyear12187 / 365;'); document.writeln(' nummonth12187 = numyear12187 / 12;'); document.writeln(' doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value = numday12187;'); document.writeln(' doc'+'ument.getElementById("nummonth12187-amazon-royalties-estimator").value = nummonth12187;'); document.writeln(' doc'+'ument.getElementById("numyear12187-amazon-royalties-estimator").value = numyear12187;'); document.writeln(' CalculateRoyaltyNumbers12187();'); document.writeln(' Update7Values12187();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerDay12187()'); document.writeln('{'); document.writeln(' royday12187 = doc'+'ument.getElementById("royday12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royday12187 = parseFloat(royday12187);'); document.writeln(' doc'+'ument.getElementById("royday12187-amazon-royalties-estimator").value = royday12187;'); document.writeln('// royday12187 = parseFloat(doc'+'ument.getElementById("royday12187-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royday12187) ) { royday12187 = 0; }'); document.writeln(' royyear12187 = royday12187 * 365;'); document.writeln(' roymonth12187 = royyear12187 / 12;'); document.writeln(' numday12187 = royday12187 / (readonly12187 * numtitles12187);'); document.writeln(' DetermineNumberSoldPerPeriods12187()'); document.writeln(' Update7Values12187();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerMonth12187()'); document.writeln('{'); document.writeln(' roymonth12187 = doc'+'ument.getElementById("roymonth12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' roymonth12187 = parseFloat(roymonth12187);'); document.writeln(' doc'+'ument.getElementById("roymonth12187-amazon-royalties-estimator").value = roymonth12187;'); document.writeln('// roymonth12187 = parseFloat(doc'+'ument.getElementById("roymonth12187-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(roymonth12187) ) { roymonth12187 = 0; }'); document.writeln(' royyear12187 = roymonth12187 * 12;'); document.writeln(' royday12187 = royyear12187 / 365;'); document.writeln(' numday12187 = royday12187 / (readonly12187 * numtitles12187);'); document.writeln(' DetermineNumberSoldPerPeriods12187()'); document.writeln(' Update7Values12187();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerYear12187()'); document.writeln('{'); document.writeln(' royyear12187 = doc'+'ument.getElementById("royyear12187-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royyear12187 = parseFloat(royyear12187);'); document.writeln(' doc'+'ument.getElementById("royyear12187-amazon-royalties-estimator").value = royyear12187;'); document.writeln('// royyear12187 = parseFloat(doc'+'ument.getElementById("royyear12187-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royyear12187) ) { royyear12187 = 0; }'); document.writeln(' royday12187 = royyear12187 / 365;'); document.writeln(' roymonth12187 = royyear12187 / 12;'); document.writeln(' numday12187 = royday12187 / (readonly12187 * numtitles12187);'); document.writeln(' DetermineNumberSoldPerPeriods12187()'); document.writeln(' Update7Values12187();'); document.writeln('}'); document.writeln(''); document.writeln('function DetermineNumberSoldPerPeriods12187()'); document.writeln('{'); document.writeln(' numyear12187 = numday12187 * 365;'); document.writeln(' nummonth12187 = numyear12187 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function FinishCalculation12187()'); document.writeln('{'); document.writeln(' Calculate6Numbers12187();'); document.writeln(' Update7Values12187();'); document.writeln('}'); document.writeln(''); document.writeln('function Calculate6Numbers12187()'); document.writeln('{'); document.writeln(' // numday12187 is assumed to be have the correct value.'); document.writeln(' readonly12187 = ( price12187 * (rate12187/100) ) - delivery12187;'); document.writeln(' DetermineNumberSoldPerPeriods12187();'); document.writeln(' royday12187 = numtitles12187 * readonly12187 * numday12187;'); document.writeln(' royyear12187 = royday12187 * 365;'); document.writeln(' roymonth12187 = royyear12187 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function CalculateRoyaltyNumbers12187()'); document.writeln('{'); document.writeln(' // numday12187 is assumed to be have the correct value.'); document.writeln(' readonly12187 = ( price12187 * (rate12187/100) ) - delivery12187;'); document.writeln(' royday12187 = numtitles12187 * readonly12187 * numday12187;'); document.writeln(' royyear12187 = royday12187 * 365;'); document.writeln(' roymonth12187 = royyear12187 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function Update7Values12187()'); document.writeln('{'); document.writeln('//rate12187-35-amazon-royalties-estimator'); document.writeln(' doc'+'ument.getElementById("readonly12187-amazon-royalties-estimator").innerHTML = ReturnCurrencyNumberCommaized12187(readonly12187,2);'); document.writeln(' doc'+'ument.getElementById("numday12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(numday12187,0);'); document.writeln(' doc'+'ument.getElementById("nummonth12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(nummonth12187,0);'); document.writeln(' doc'+'ument.getElementById("numyear12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(numyear12187,0);'); document.writeln(' doc'+'ument.getElementById("royday12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(royday12187,2);'); document.writeln(' doc'+'ument.getElementById("roymonth12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(roymonth12187,2);'); document.writeln(' doc'+'ument.getElementById("royyear12187-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized12187(royyear12187,2);'); document.writeln('}'); document.writeln(''); document.writeln('function ReturnCurrencyNumber12187(n,d) { return n.toFixed(d); }'); document.writeln(''); document.writeln('function ReturnCurrencyNumberCommaized12187(n,d)'); document.writeln('{'); document.writeln(' var number = ReturnCurrencyNumber12187(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('');