0

I am currently using this

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

But it doesn't seem to work

  • I think that your showing script changes `numberFormat` to `"type": "CURRENCY"`. So, unfortunately, I cannot understand `But it doesn't seem to work`. I apologize for this. In order to correctly understand your question, can you provide your sample input and output situations you expect as the images? – Tanaike Sep 29 '22 at 23:35
  • Hey @Tanaike You can see I created an issue [https://github.com/burnash/gspread/issues/1117](https://github.com/burnash/gspread/issues/1117) But here is some code ```py sheet.update("C3", 6000000) sheet.format("C3:C3", {"numberFormat": {"type": "CURRENCY"}}) ``` – Md. Shahriyar Alam Sep 30 '22 at 22:43
  • Thank you for replying. From your link, I proposed a modification point an answer. Could you please confirm it? – Tanaike Sep 30 '22 at 23:25

1 Answers1

0

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:

Tanaike
  • 181,128
  • 11
  • 97
  • 165