Thank you Roni for the reply. Tried the format you gave, but does not work. Will try to use the script now. Thanks once again.
-- Regards Gaurav Shah On Oct 23, 9:38 pm, Roni Biran <[email protected]> wrote: > As far as I know, the appropriate formatting for this is '#,##,##0.00' and > not as you mentioned. However, I think that you are right and the API does > not support this formatting. > You might want to use your own number formatter while going over the data. > You can set data value that will be displayed differently than the value > needed for calculations. > > I wrote a small script that might help you: > > function ConvertToIndian(inputString) { > inputString = inputString.toString(); > var numberArray = inputString.split('.', 2); > var pref = parseInt(numberArray[0]); > var suf = numberArray[1]; > > var outputString = ''; > > if (isNaN(pref)) return ''; > var minus = ''; > if (pref < 0) minus = '-'; > pref = Math.abs(pref).toString(); > > if (pref.length > 3) { > var lastThree = pref.substr(pref.length - 3, pref.length); > pref = pref.substr(0, pref.length - 3); > > if (pref.length % 2 > 0) { > outputString += pref.substr(0, 1) + ','; > pref = pref.substr(1, pref.length - 1);} > > while (pref.length >= 2) { > outputString += pref.substr(0, 2) + ','; > pref = pref.substr(2, pref.length); > > } > > outputString += lastThree;} else { > > outputString = minus + pref; > > } > > if (!isNaN(suf)) outputString += '.' + suf; > > return outputString; > > } > > Good luck, > > > > > > > > On Sun, Oct 23, 2011 at 4:28 PM, gshah <[email protected]> wrote: > > Hi, I am making a website focused on Indians where I need to show > > statistics. But I am facing a problem with displaying numbers on the > > vAxis of a ColumnChart. Currently it displays the numbers in the > > Western format. But in India, we use a different set of positions of > > separators in the numbers. > > > In India, we do not place separators in a number after every 3 digits. > > Instead, we write numbers like this. > > > 100,000 is written as 1,00,000 > > 10,000,000 is written as 1,00,00,000 > > 1,000,000,000 is written as 1,00,00,00,000 > > 100,000,000,000 is written as 1,00,00,00,00,000 > > > The first separator (from right) is placed after 3 digits but beyond > > that every separator is placed after 2 digits. I am unable to grasp > > how to instruct the Google Visualization API to display the numbers on > > the vAxis of a ColumnChart in the Indian format. > > > I tried vAxis: {format: '#,##,##,##,##0.00'} > > But this does not work. > > > Please help anyone. I will be really grateful. > > > -- > > Regards > > Gaurav Shah > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Visualization API" group. > > To post to this group, send email to > > [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group at > >http://groups.google.com/group/google-visualization-api?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
