How to Format Numbers Using the Google Embed API - Decimal Placement Limitations - Integers

I would like to format the numbers returned using the Google Embed API, mainly controlling the decimal count and comma placement for the 1000+ numbers.

I found this NumberFormat documentation for Google Charts, as well as the following link in the insert reference guide:
https://developers.google.com/chart/interactive/docs/reference#numberformatter https://developers.google.com/analytics/ devguides / reporting / embed / v1 / reference

The syntax is different from Embed, so formatting Google Charts numbers doesn't seem to apply.

Here is my Embed syntax ... I assume there is a way to add number formatting options, similar to what I placed in the options below:

var avgSessionDuration = new gapi.analytics.googleCharts.DataChart({
reportType: 'ga',
query: {
  'metrics': 'ga:avgSessionDuration',
  'start-date': '30daysAgo',
  'end-date': 'yesterday',
},
chart: {
  type: 'TABLE',
  container: 'avgSessionDuration',
  options: {
    'NumberFormat': {
      pattern: '$###,###'
    }
  }
}

});

, Embed , .

!

+4
1

'NumberFormat'. , , .

0

All Articles