Last active
February 20, 2023 16:52
-
-
Save jesusalber1/c995ff11bcf7cff6afbce385ade60441 to your computer and use it in GitHub Desktop.
[Google Scripts] Replace commas with dots in Google Spreadsheets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceCommasDots() { | |
var id = ''; /* Your spreadsheet id (value after /id/*): https://docs.google.com/spreadsheets/d/:id/edit */ | |
var sheet = SpreadsheetApp.openById(id); | |
var range = sheet.getRange("A1:B2"); /* range you want to modify */ | |
var data = range.getValues(); | |
for (var row = 0; row < data.length; row++) { | |
for (var col = 0; col < data[row].length; col++) { | |
data[row][col] = (data[row][col]).toString().replace(/,/g, '.'); | |
} | |
} | |
range.setValues(data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment