How to replace dot by comma in javascript ?

Hello, 

I have to replace dot by comma in numerics fields but I can't manage to do it.

I add a javascript in a form action, on submit : 

var fieldtxt = GetFieldValue("My field name").replace(".",",");

console.log(fieldtxt);

But I have an error that tells me that "replace" is not found.

How can I do this ? 

Any idea ?
Thank you for helping.