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 numtitles83772, price83772, rate83772, delivery83772, latestdelivery83772, readonly83772, numday83772, nummonth83772, numyear83772, royday83772, roymonth83772, royyear83772;'); document.writeln('InitialSetup83772();'); document.writeln(''); document.writeln('function InitialSetup83772()'); document.writeln('{'); document.writeln(' numtitles83772 = 3;'); document.writeln(' price83772 = 2.99;'); document.writeln(' delivery83772 = latestdelivery83772 = 0.06;'); document.writeln(' numday83772 = 10;'); document.writeln(' rate83772 = 0;'); document.writeln(' if( price83772 >= 2.99 && price83772 <= 9.99 )'); document.writeln(' {'); document.writeln(' rate83772 = 70;'); document.writeln(' doc'+'ument.getElementById("rate83772-35-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate83772-70-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate83772-amazon-royalties-estimator").value = 70;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' rate83772 = 35;'); document.writeln(' doc'+'ument.getElementById("rate83772-35-amazon-royalties-estimator").checked = true;'); document.writeln(' doc'+'ument.getElementById("rate83772-70-amazon-royalties-estimator").checked = false;'); document.writeln(' doc'+'ument.getElementById("rate83772-amazon-royalties-estimator").value = 35;'); document.writeln(' }'); document.writeln(' doc'+'ument.getElementById("numtitles83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(numtitles83772,0);'); document.writeln(' doc'+'ument.getElementById("price83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(price83772,2);'); document.writeln(' doc'+'ument.getElementById("delivery83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(delivery83772,2);'); document.writeln(' doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(numday83772,2);'); document.writeln(' FinishCalculation83772();'); document.writeln('}'); document.writeln(''); document.writeln('function UpdateAll83772()'); document.writeln('{'); document.writeln(' numtitles83772 = doc'+'ument.getElementById("numtitles83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numtitles83772 = parseInt(numtitles83772);'); document.writeln(' doc'+'ument.getElementById("numtitles83772-amazon-royalties-estimator").value = numtitles83772;'); document.writeln('// numtitles83772 = parseInt(doc'+'ument.getElementById("numtitles83772-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numtitles83772) )'); document.writeln(' {'); document.writeln(' numtitles83772 = 0;'); document.writeln(' doc'+'ument.getElementById("numtitles83772-amazon-royalties-estimator").value = numtitles83772;'); document.writeln(' }'); document.writeln(' price83772 = doc'+'ument.getElementById("price83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' price83772 = parseFloat(price83772);'); document.writeln(' doc'+'ument.getElementById("price83772-amazon-royalties-estimator").value = price83772;'); document.writeln('// price83772 = parseFloat(doc'+'ument.getElementById("price83772-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(price83772) )'); document.writeln(' {'); document.writeln(' price83772 = \'0.0\';'); document.writeln(' doc'+'ument.getElementById("price83772-amazon-royalties-estimator").value = price83772;'); document.writeln(' }'); document.writeln(' rate83772 = doc'+'ument.getElementById("rate83772-70-amazon-royalties-estimator").checked ? 70 : 35;'); document.writeln(' doc'+'ument.getElementById("rate83772-amazon-royalties-estimator").value = rate83772;'); document.writeln(' delivery83772 = doc'+'ument.getElementById("delivery83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' delivery83772 = parseFloat(delivery83772);'); document.writeln(' doc'+'ument.getElementById("delivery83772-amazon-royalties-estimator").value = delivery83772;'); document.writeln('// delivery83772 = parseFloat(doc'+'ument.getElementById("delivery83772-amazon-royalties-estimator").value);'); document.writeln(' doc'+'ument.getElementById("delivery83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772( parseFloat(doc'+'ument.getElementById("delivery83772-amazon-royalties-estimator").value), 2 );'); document.writeln(' if( rate83772 < 70 )'); document.writeln(' {'); document.writeln(' if( delivery83772 > 0 ) { latestdelivery83772 = delivery83772; }'); document.writeln(' doc'+'ument.getElementById("delivery83772-amazon-royalties-estimator").value = \'0.00\';'); document.writeln(' delivery83772 = 0.0;'); document.writeln(' }'); document.writeln(' else'); document.writeln(' {'); document.writeln(' if( delivery83772 <= 0 && latestdelivery83772 > 0 )'); document.writeln(' {'); document.writeln(' delivery83772 = latestdelivery83772;'); document.writeln(' doc'+'ument.getElementById("delivery83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(delivery83772,2);'); document.writeln(' }'); document.writeln(' }'); document.writeln(''); document.writeln(' if( isNaN(delivery83772) )'); document.writeln(' {'); document.writeln(' delivery83772 = \'0.00\';'); document.writeln(' doc'+'ument.getElementById("delivery83772-amazon-royalties-estimator").value = delivery83772;'); document.writeln(' }'); document.writeln(' readonly83772 = ( numday83772 * (rate83772/100) ) - delivery83772;'); document.writeln(' numday83772 = doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday83772 = parseInt(numday83772);'); document.writeln(' doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value = numday83772;'); document.writeln('// numday83772 = parseInt(doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday83772) )'); document.writeln(' {'); document.writeln(' numday83772 = 0;'); document.writeln(' doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value = numday83772;'); document.writeln(' }'); document.writeln(' FinishCalculation83772();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerDay83772()'); document.writeln('{'); document.writeln(' numday83772 = doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numday83772 = parseInt(numday83772);'); document.writeln(' doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value = numday83772;'); document.writeln('// numday83772 = parseInt(doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numday83772) ) { numday83772 = 0; }'); document.writeln(' DetermineNumberSoldPerPeriods83772();'); document.writeln(' CalculateRoyaltyNumbers83772();'); document.writeln(' Update7Values83772();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerMonth83772()'); document.writeln('{'); document.writeln(' nummonth83772 = doc'+'ument.getElementById("nummonth83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' nummonth83772 = parseInt(nummonth83772);'); document.writeln(' doc'+'ument.getElementById("nummonth83772-amazon-royalties-estimator").value = nummonth83772;'); document.writeln('// nummonth83772 = parseInt(doc'+'ument.getElementById("nummonth83772-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(nummonth83772) ) { nummonth83772 = 0; }'); document.writeln(' numyear83772 = nummonth83772 * 12;'); document.writeln(' numday83772 = numyear83772 / 365;'); document.writeln(' doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value = numday83772;'); document.writeln(' doc'+'ument.getElementById("nummonth83772-amazon-royalties-estimator").value = nummonth83772;'); document.writeln(' doc'+'ument.getElementById("numyear83772-amazon-royalties-estimator").value = numyear83772;'); document.writeln(' CalculateRoyaltyNumbers83772();'); document.writeln(' Update7Values83772();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromNumPerYear83772()'); document.writeln('{'); document.writeln(' numyear83772 = doc'+'ument.getElementById("numyear83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' numyear83772 = parseInt(numyear83772);'); document.writeln(' doc'+'ument.getElementById("numyear83772-amazon-royalties-estimator").value = numyear83772;'); document.writeln('// numyear83772 = parseInt(doc'+'ument.getElementById("numyear83772-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(numyear83772) ) { numyear83772 = 0; }'); document.writeln(' numday83772 = numyear83772 / 365;'); document.writeln(' nummonth83772 = numyear83772 / 12;'); document.writeln(' doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value = numday83772;'); document.writeln(' doc'+'ument.getElementById("nummonth83772-amazon-royalties-estimator").value = nummonth83772;'); document.writeln(' doc'+'ument.getElementById("numyear83772-amazon-royalties-estimator").value = numyear83772;'); document.writeln(' CalculateRoyaltyNumbers83772();'); document.writeln(' Update7Values83772();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerDay83772()'); document.writeln('{'); document.writeln(' royday83772 = doc'+'ument.getElementById("royday83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royday83772 = parseFloat(royday83772);'); document.writeln(' doc'+'ument.getElementById("royday83772-amazon-royalties-estimator").value = royday83772;'); document.writeln('// royday83772 = parseFloat(doc'+'ument.getElementById("royday83772-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royday83772) ) { royday83772 = 0; }'); document.writeln(' royyear83772 = royday83772 * 365;'); document.writeln(' roymonth83772 = royyear83772 / 12;'); document.writeln(' numday83772 = royday83772 / (readonly83772 * numtitles83772);'); document.writeln(' DetermineNumberSoldPerPeriods83772()'); document.writeln(' Update7Values83772();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerMonth83772()'); document.writeln('{'); document.writeln(' roymonth83772 = doc'+'ument.getElementById("roymonth83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' roymonth83772 = parseFloat(roymonth83772);'); document.writeln(' doc'+'ument.getElementById("roymonth83772-amazon-royalties-estimator").value = roymonth83772;'); document.writeln('// roymonth83772 = parseFloat(doc'+'ument.getElementById("roymonth83772-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(roymonth83772) ) { roymonth83772 = 0; }'); document.writeln(' royyear83772 = roymonth83772 * 12;'); document.writeln(' royday83772 = royyear83772 / 365;'); document.writeln(' numday83772 = royday83772 / (readonly83772 * numtitles83772);'); document.writeln(' DetermineNumberSoldPerPeriods83772()'); document.writeln(' Update7Values83772();'); document.writeln('}'); document.writeln(''); document.writeln('function RecalculateFromRoyaltyPerYear83772()'); document.writeln('{'); document.writeln(' royyear83772 = doc'+'ument.getElementById("royyear83772-amazon-royalties-estimator").value.replace(/[^\\d\\.]/g,"");'); document.writeln(' royyear83772 = parseFloat(royyear83772);'); document.writeln(' doc'+'ument.getElementById("royyear83772-amazon-royalties-estimator").value = royyear83772;'); document.writeln('// royyear83772 = parseFloat(doc'+'ument.getElementById("royyear83772-amazon-royalties-estimator").value);'); document.writeln(' if( isNaN(royyear83772) ) { royyear83772 = 0; }'); document.writeln(' royday83772 = royyear83772 / 365;'); document.writeln(' roymonth83772 = royyear83772 / 12;'); document.writeln(' numday83772 = royday83772 / (readonly83772 * numtitles83772);'); document.writeln(' DetermineNumberSoldPerPeriods83772()'); document.writeln(' Update7Values83772();'); document.writeln('}'); document.writeln(''); document.writeln('function DetermineNumberSoldPerPeriods83772()'); document.writeln('{'); document.writeln(' numyear83772 = numday83772 * 365;'); document.writeln(' nummonth83772 = numyear83772 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function FinishCalculation83772()'); document.writeln('{'); document.writeln(' Calculate6Numbers83772();'); document.writeln(' Update7Values83772();'); document.writeln('}'); document.writeln(''); document.writeln('function Calculate6Numbers83772()'); document.writeln('{'); document.writeln(' // numday83772 is assumed to be have the correct value.'); document.writeln(' readonly83772 = ( price83772 * (rate83772/100) ) - delivery83772;'); document.writeln(' DetermineNumberSoldPerPeriods83772();'); document.writeln(' royday83772 = numtitles83772 * readonly83772 * numday83772;'); document.writeln(' royyear83772 = royday83772 * 365;'); document.writeln(' roymonth83772 = royyear83772 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function CalculateRoyaltyNumbers83772()'); document.writeln('{'); document.writeln(' // numday83772 is assumed to be have the correct value.'); document.writeln(' readonly83772 = ( price83772 * (rate83772/100) ) - delivery83772;'); document.writeln(' royday83772 = numtitles83772 * readonly83772 * numday83772;'); document.writeln(' royyear83772 = royday83772 * 365;'); document.writeln(' roymonth83772 = royyear83772 / 12;'); document.writeln('}'); document.writeln(''); document.writeln('function Update7Values83772()'); document.writeln('{'); document.writeln('//rate83772-35-amazon-royalties-estimator'); document.writeln(' doc'+'ument.getElementById("readonly83772-amazon-royalties-estimator").innerHTML = ReturnCurrencyNumberCommaized83772(readonly83772,2);'); document.writeln(' doc'+'ument.getElementById("numday83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(numday83772,0);'); document.writeln(' doc'+'ument.getElementById("nummonth83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(nummonth83772,0);'); document.writeln(' doc'+'ument.getElementById("numyear83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(numyear83772,0);'); document.writeln(' doc'+'ument.getElementById("royday83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(royday83772,2);'); document.writeln(' doc'+'ument.getElementById("roymonth83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(roymonth83772,2);'); document.writeln(' doc'+'ument.getElementById("royyear83772-amazon-royalties-estimator").value = ReturnCurrencyNumberCommaized83772(royyear83772,2);'); document.writeln('}'); document.writeln(''); document.writeln('function ReturnCurrencyNumber83772(n,d) { return n.toFixed(d); }'); document.writeln(''); document.writeln('function ReturnCurrencyNumberCommaized83772(n,d)'); document.writeln('{'); document.writeln(' var number = ReturnCurrencyNumber83772(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('');