Change dot to comma

Hello there everyone! The code works well if i want to convert 1.5 and I get the result (1:30)
My problem is that i want to convert 1,5 and get the same result, but only get NaN:NaN.

In other words, change the dot to a comma. I dont know how to change it, if someone know and will try to help me out, it would be much pleasent.

The script sounds:

	<input id="num" value="0"><br>
	 <br><p><b>result</b><br></p> <input id="HHMM" value="">

	<script type="text/javascript">

	function convertToHHMM(result) {
	 var hrs = parseInt(Number(result));
	 var min = Math.round((Number(result)-hrs) * 60);
	 return hrs+':'+min;


JavaScript does not know how to handle commas when trying to cast strings as numbers. When you attempt to treat a non-cast-able string as a number, you will get NaN as the answer. You will want to do some string manipulations on your result before setting hrs.