Hi,
Ik ben bezig met een calculate systeem voor een winkelwagen maar ik wil het totaal bedrag afronden op 2 decimalen.
Maar het lukt niet echt. En het bedrag veranderd ook niet in google chrome.
Wie kan me helpen?
Ik ben bezig met een calculate systeem voor een winkelwagen maar ik wil het totaal bedrag afronden op 2 decimalen.
Maar het lukt niet echt. En het bedrag veranderd ook niet in google chrome.
<script type="text/javascript">
function changeVal(price)
{
num = (price + [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]entities[COLOR= #007700]([/COLOR][URL="http://www.php.net/number_format"]number_format[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$topal[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000].[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]));[/COLOR] ?>);
document.getElementById(total).innerHTML = Math.round(num*1000)/1000;
}
</script> Wie kan me helpen?
