Format a specific cell with currency rounded format using gspread in python

466 views Asked by At

I am currently using this

sheet.format("C3:C3", {"numberFormat": {"type": "CURRENCY"}})

But it doesn't seem to work

1

There are 1 answers

0
Tanaike On

From your following script and But it doesn't seem to work. Also on the sheet when I click on the cell I see its adding a ' before the number which is only visible on the formula,

sheet.update("C3", 6000000)
sheet.format("C3:C3", {"numberFormat": {"type": "CURRENCY"}})

In this case, how about using value_input_option as follows?

Modified script:

sheet.update("C3", 6000000, value_input_option="USER_ENTERED")
sheet.format("C3:C3", {"numberFormat": {"type": "CURRENCY"}})

or

sheet.update("C3", 6000000, value_input_option="USER_ENTERED")
sheet.format("C3", {"numberFormat": {"type": "CURRENCY"}})

Reference: