NaN is an error code returned by Javascript (hence why it only appears in a browser). It stands for Not A Number. I'd check the values of the numbers your adding up, and ensure that they have numbers in them (and are not null).
if one of the variables is as you posted "12,50", then that's a problem because of the comma -- which is then interpreted to be text string.