Formatting numbers read from spreadsheet

前端 未结 5 570
终归单人心
终归单人心 2020-12-14 21:45

I\'m writing a script that creates fixed-width-text output of the contents of a Google Apps Spreadsheet. I retrieve all the values of the current range using the range

5条回答
  •  半阙折子戏
    2020-12-14 21:51

    Try the following google apps script

    function NumberFormat()
    {var ss = SpreadsheetApp.getActiveSpreadsheet();
     var sheet = ss.getSheets()[0];
    
     var cell = sheet.getRange("A1:B10");
     // Always show 2 decimal points
     cell.setNumberFormat("0,00,000.00");
    }
    

提交回复
热议问题