Daniel! Awesome! What an easy fix! Thank you so much!!
On Wednesday, November 30, 2016 at 10:38:04 AM UTC-5, Daniel LaLiberte wrote: > > The value field remains the same, just a value. What you want to do is > getFormattedValue(). > > On Wed, Nov 30, 2016 at 10:21 AM, David H Ramirez <[email protected] > <javascript:>> wrote: > >> Hello, >> >> I'm using GViz to populate a webpage with data from a Google Spreadsheet. >> The columns are different types, however. Some are currency and some are >> percentages. I've tried using GViz's NumberFormat to set a '$' as a >> 'prefix'; I've even tried to set a 'pattern'. None of which seems to work. >> Can some help me out? I've included the code below. >> >> var data = response.getDataTable(); >> >> //console.log(data); >> >> var formatter = new google.visualization.NumberFormat({prefix:'$', >> pattern:'$###,###'}); >> formatter.format(data, 1); // Apply formatter to second column >> >> >> $bud01.html(data.getValue(0, 0)); >> $bud02.html(data.getValue(1, 0)); >> $bud03.html(data.getValue(2, 0)); >> $bud04.html(data.getValue(3, 0)); >> $bud05.html(data.getValue(4, 0)); >> $bud06.html(data.getValue(5, 0)); >> >> $res01.html(data.getValue(0, 1)); >> $res02.html(data.getValue(1, 1)); >> $res03.html(data.getValue(2, 1)); >> $res04.html(data.getValue(3, 1)); >> $res05.html(data.getValue(4, 1)); >> $res06.html(data.getValue(5, 1)); >> >> $bp01.html(data.getValue(0, 2)); >> $bp02.html(data.getValue(1, 2)); >> $bp03.html(data.getValue(2, 2)); >> $bp04.html(data.getValue(3, 2)); >> $bp05.html(data.getValue(4, 2)); >> $bp06.html(data.getValue(5, 2)); >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Visualization API" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at >> https://groups.google.com/group/google-visualization-api. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/google-visualization-api/657c6e1d-9bfe-4c85-be9a-1231030927c3%40googlegroups.com >> >> <https://groups.google.com/d/msgid/google-visualization-api/657c6e1d-9bfe-4c85-be9a-1231030927c3%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> > [email protected] <javascript:> 5CC, Cambridge MA > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/5ea9949b-84a6-4b1e-b710-c079551a3369%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
