I created a coin minimizer for DnD 5e

If you are worried by strange links - please just take the code

<html> <head> <title> </title> </head> <body> <h1>Flatten your purse to least values</h1> <p> Just enter the values in your purse and it (should) calculate the least amount of coins needed. To make sure it calc's properly click outside the table. Enter you coins into the value column </p> <table border=1> <tr> <th>Type</th> <th>Value</th> <th>x to CP</th> <th>in CP</th> <th>Optimum</th> </tr> <tr> <td>Platinum:</td> <td><input id="pp" onchange="Flatten()" type="text"></td> <td> x 1000</td> <td id="pp_in_cp"></td> <td id="new_pp"></td> </tr> <tr> <td>Gold:</td> <td><input id="gp" onchange="Flatten()" type="text"></td> <td> x 100</td> <td id="gp_in_cp"></td> <td id="new_gp"></td> </tr> <tr> <td>Electrum:</td> <td><input id="ep" onchange="Flatten()" type="text"></td> <td> x 50</td> <td id="ep_in_cp"></td> <td id="new_ep"></td> </tr> <tr> <td>Silver:</td> <td><input id="sp" onchange="Flatten()" type="text"></td> <td> x 10</td> <td id="sp_in_cp"></td> <td id="new_sp"></td> </tr> <tr> <td>Copper:</td> <td><input id="cp" onchange="Flatten()" type="text"></td> <td> x 1</td> <td id="cp_in_cp"></td> <td id="new_cp"></td> </tr> <tr> <td colspan=3><b>Total:</td> <td id="total"></td> <td> </td> </tr> </table> <p><b>This webserver carries Clacks overhead - <a href="http://www.gnuterrypratchett.com/" target=_blank>About Clacks Overhead</a></b></p>

  <script>
     function Flatten()
     {
        var v_pp=pp.value * 1000;
        pp_in_cp.innerHTML=v_pp.toString();
        var v_gp=gp.value * 100;
        gp_in_cp.innerHTML=v_gp.toString();
        var v_ep=ep.value * 50;
        ep_in_cp.innerHTML=v_ep.toString();
        var v_sp=sp.value * 10;
        sp_in_cp.innerHTML=v_sp.toString();
        var v_cp=cp.value * 1;
        cp_in_cp.innerHTML=v_cp.toString();
        var v_total=v_pp + v_gp + v_ep + v_sp + v_cp;
        total.innerHTML=v_total.toString();

        new_pp.innerHTML=Math.floor(v_total/1000);
        v_total-=Math.floor(v_total/1000)*1000;
        new_gp.innerHTML=Math.floor(v_total/100);
        v_total-=Math.floor(v_total/100)*100;
        new_ep.innerHTML=Math.floor(v_total/50);
        v_total-=Math.floor(v_total/50)*50;
        new_sp.innerHTML=Math.floor(v_total/10);
        v_total-=Math.floor(v_total/10)*10;
        new_cp.innerHTML=v_total;

     }
  </script>

</body> </html>

/r/DnD Thread