tidyverse/googlesheets4

Feature Request: Something like Googlescripts' `.setNumberFormat()`

benyamindsmith opened this issue · 0 comments

First off, thank Jenny an all other contributors for putting so much work in such a useful R package!

I am working with using googlesheets4 for some automations but I have noticed that there are challenges with being able to format data in a human readable format that is also compatible with sheets (i.e. without a leading apostrophe '). After playing around with recording some macros on Google Sheets/App Scripts I discovered the setNumberFormat() method.

E.g.

mySheet.getRange('BE:BE').setNumberFormat('m"/"d"/"yy')

I wonder if it would be possible to have a function like gs4_formula() that would be able to format numbers in a desired format.

E.g for dates:

(excuse the messy code)

df$dates_formatted <- gs4_set_number_format(df$dates,"m/d/yy")