I'm using the Google Sheets API (v4) to create/update spreadsheets programmatically and have run into the following issue:
I have seen via the JavaDoc that to set the cell to a NumberFormat of say, CURRENCY, I can set the NumberFormat type and pattern to:
"cell": {
"userEnteredFormat": {
"numberFormat": {
"type": "CURRENCY",
"pattern": "[$¥-411]#,##0.00" // <--- Added
}
}
},
"fields": "userEnteredFormat.numberFormat" // or "fields": "userEnteredFormat"
However, I do not see an option to set the NumberFormat type to DURATION. The acceptable enums I have found include: NUMBER_FORMAT_TYPE_UNSPECIFIED, TEXT, NUMBER, PERCENT, CURRENCY, DATE, TIME, DATE_TIME, SCIENTIFIC. Is there any way to set a cell format to a type Duration mimicking what you can do via UI?
After: