I have the following JavaScript code:
var calculation = $('select[name=somevalue1] option:selected').data('calc')-($('select[name=somevalue1] option:selected').data('calc')/100*$('select[name=somevalue2] option:selected').data('calc'))-($('select[name=somevalue1] option:selected').data('calc')-($('select[name=somevalue1] option:selected').data('calc')/100*$('select[name=somevalue2] option:selected').data('calc')))/100*$('select[name=somevalue3] option:selected').data('calc');
$('#calculation').text((calculation).toFixed(2).replace(".",","))
That will calculate a number, change .
to ,
and round it to two digits after comma.
What I need to do is to add a dot after tree digits before come.
Means:
1.234,56
instead of 1234,56
1.234.567,89
instead of 1234567,89
Does anybody know a way to do that?