Als netto - bruto = btw dan krijg je bij 19%: bruto = 100 / 119 * netto en btw = 19 / 119 * nettode .toFixed(2) rond het af op 2 decimalen.PHP:<html> <head> <title>netto - bruto = btw</title> </head> <body> <script type="text/javascript"> <!-- var netto = prompt('Nettoprijs=',''); netto = parseFloat(netto); var btw = (19 / 119 * netto).toFixed(2); var bruto = (100 / 119 * netto).toFixed(2); netto = netto.toFixed(2); window.alert('netto: ' + netto + ' - bruto: ' + bruto + ' = btw: ' + btw); // --> </script> </body> </html>
Vr.Gr. Egel.