How can I get rid of the scientific number formatting of Google Sheets via Google Apps Script?

5.5k views Asked by At

Is there a way to obtain a cell value from Google Sheets which contains a phone number as text in Google Apps Script.

I mean. My sheet contains a list of employees with names and phone numbers like:

Employee  phone          mail
Emp1.     5544477991     [email protected]
Emp1.     1234567988     [email protected]
...       .......        ......

An on the script I wrote:

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
R=sheet.getRange("A1:D2").getValues();
for (var f = 0 ; f<3 ; f++) {
    Logger.log(R[0][f])
}

For 5544477991 I get 5.54447799E9.

How can I get rid of the scientific number formatting of Google Sheets via Google Apps Script?

1

There are 1 answers

0
Hermandroid On

Thanks user1989 using toString() works perfectly.