javascript - Format not working -
code provided @krr
function insertphonenumbers() { var ss = spreadsheetapp.getactivespreadsheet(); var targetsheet = ss.getsheetbyname("report"); var sourcesheet = ss.getsheetbyname("sheet1"); var nrange = sourcesheet.getrange(2, 3, sourcesheet.getlastrow(), 1) var sourcenotes = nrange.getvalues() //logger.log(sourcenotes); var notes = targetsheet.getrange(2, 6, sourcesheet.getlastrow(),1) var formatednotes = notes.setnumberformat(0); notes.setnotes(sourcenotes);
works , supposed added
var formatednotes = notes.setnumberformat(0);
but output i'm getting same if don't put formatting instruction, is:
0000000000.00000
it should (as per code)
00000000000
my first attempt
var formatednotes = notes.setnumberformat('(000) 000-0000')
didn't work either trying get
(123) 456-7890
bottom line can't format work.
warp format in quotation marks. setnumberformat("0")
or setnumberformat("(000) 000-0000")
works fine me that.
otherwise, make sure you're getting correct sheets.
Comments
Post a Comment