De makkelijkste manier is om dit met PHP te doen mits je die mogelijkheid hebt.
Je zou dan bijvoorbeeld als volgt kunnen doen:
--------------------------------------------------
echo number_format($total, 2, '.', ',');
Uitleg:
$total = variabele totaalbedrag
2 = aantal cijfers achter de komma
. = het scheidingsteken voor 1000 tallen dus : 100000 => 100.000
, = het scheidingsteken achter de "komma" dus: 100.000,23
--------------------------------------------------
Indien dit niet kan moet je kijken naar javascript hoewel dit niet door iedereen ingeschakeld hoeft te zijn.
Ik weet niet of volgende code werkt maar deze heb ik gevonden via google : javascript currency format
------------------------------------------
<!-- TWO STEPS TO INSTALL CURRENCY FORMAT:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Cyanide_7 (leo7278@hotmail.com) -->
<!-- Web Site:
http://www7.ewebcity.com/cyanide7 -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://javascript.internet.com -->
<!-- Begin
function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form name=currencyform>
Enter a number then click the button: <input type=text name=input size=10 value="1000434.23">
<input type=button value="Convert" onclick="this.form.input.value=formatCurrency(this.form.input.value);">
<br><br>
or enter a number and click another field: <input type=text name=input2 size=10 value="1000434.23" onBlur="this.value=formatCurrency(this.value);">
</form>
</center>