How to get R plotly to separate thousands with comma?

Thousand commas won't load

Using scales library - labels = comma

plot_ly(x = ecomm_yoy2$YOY, y = ecomm_yoy2$Brand, type = 'bar', orientation = 'h', color = ~ecomm_yoy2$YOY < 0, colors = c("steelblue", "red"), name = ~ifelse(ecomm_yoy2$YOY < 0, "< 0", ">= 0")) %>%
  layout(xaxis = list(title = "YOY change in £")) %>% 
  layout(yaxis = list(categoryarray = ecomm_yoy2$YOY, categoryorder = "array")) %>%
  layout(showlegend = FALSE) %>%
  add_annotations(text = ecomm_yoy2$YOY, showarrow = F, xshift = 25)

No error messages but commas not applied.

Hi,

In order for us to help you with your question, please provide us a minimal reprocudible example where you provide a minimal (dummy) dataset and code that can recreate the issue. One we have that, we can go from there. For help on creating a Reprex, see this guide:

Good luck!
PJ