You need to sign in to do that
Don't have an account?

Values to be shown as per user locale/country in visualforce bar chart
Hi All,
I have a custom bar chart written in VF page where we are dsipalying records based on controller. Currently we are displayng the values in generic way. But we want to display values differently based on user locale/country. For example the value shown to Indian user will be 1,00,000 but the same value shown to US user will be in the format 100,000. Kindly provide me solution.
Thanks,
Anuj
I have a custom bar chart written in VF page where we are dsipalying records based on controller. Currently we are displayng the values in generic way. But we want to display values differently based on user locale/country. For example the value shown to Indian user will be 1,00,000 but the same value shown to US user will be in the format 100,000. Kindly provide me solution.
Thanks,
Anuj
Did you try UserInfo class in your controller? You can get running user's locale using this class. Checkout this link: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_userinfo.htm
getLocale() -Returns the context user's locale.
Now you can define your data/logic in controller to return the data to visualforce based on running user's locale.
Similarly, we have $User global variable in Visualforce to get running user's properties. https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_user.htm
Let me know if this helps.
**Please mark this as best answer if this answers your query.**
Thanks,
Manish Choudhari
14x Certified Salesforce Architect
Certification link: http://certification.salesforce.com/certification-detail-print?conId=003G000002gRrrEIAS
My Blog: http://sfdcfacts.com/
Youtube Channel: https://www.youtube.com/SFDCFacts
LinkedIn: https://www.linkedin.com/in/manish-choudhary/
Trailhead: https://trailhead.salesforce.com/en/me/manish-choudhari
Twitter: https://mobile.twitter.com/manish_sfdc
11321 in first bar value appears as 11,321 USD in USA user In Europe it appears differently in Europe like 142.44 means the values should come based on their locale.
The code is below
VF Page:
Controller: