Data Table Formating in Shiny - Number formating

I have created a data table using the following:

I have managed to format the TotalSales column as a currency as can be revealed in the following screen shot:

I need to format TotalQuantity to be comma separated so that it's readable, how can this be achieved.

Thanking you in advance

You can use formatCurrency() since there is no analogous formatNumber() but just don't specify the currency parameter (blank)

 formatCurrency(1:4, '')
1 Like

Many thanks for your input. Use of your suggested solution means that i will lose the currency formatting for the TotalSales column.

You just have to use formatCurrency() twice with different target columns.

It would be easier to help you if you could provide a minimal REPRoducible EXample (reprex)

1 Like

Was going to just say the exact thing as @andresrcs! You can pass the column names e.g.

formatCurrency('TotalSales', '$') %>% formatCurrency('TotalQuantity', '')

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.