title: Automatically replace dots with commas in a Google Sheets Column with Google Script
body: <p>I have a WooCommerce store, which is connected with Zapier to a Google spreadsheet. In this file, I keep track of the sales etc. Some of these columns contain -obviously- prices, such as price ex VAT, etc. However, for some reason the pricing values are stored in my spreadsheet as strings, such as <code>18.21</code>.</p>
  <p>To be able to automatically calculate with these values, I need to convert values in these specific columns to numbers with a comma as divider. I'm new to Google Script, but with reading some other post etc, I managed to &quot;write&quot; the following script, which almost does the job:</p>
  <pre><code>function stringIntoNumber() {
    var sheetActive = SpreadsheetApp.openById(&quot;SOME_ID&quot;);
    var sheet = sheetActive.getSheetByName(&quot;SOME_SHEETNAME&quot;);
    var range = sheet.getRange(&quot;R2:R&quot;);
     range.setValues(range.getValues().map(function(row) {
      return [row[0].replace(&quot;.&quot;, &quot;,&quot;)];
  }));
  }
  </code></pre>
  <p>The script works fine as long as only values with a dot can be found in column R. When values that belong to the range are changed to values with a comma, the script gives the error:</p>
  <blockquote>
  <p>TypeError, can't find the function Replace.</p>
  </blockquote>