How to specify what currency in DataGrid component

I have set the attribue for formatting a currency value as Format="C" in the  datagrid column, it is defaulting to GBP, whereas I need it as USD

                    <GridColumn Field=@nameof(BudgetRow.YearlyBudget) HeaderText="Yearly Budget" Width="150" Format="C"></GridColumn>

Please advise where I can specify the currency symbol for the datagrid component globally


8 Replies

PS Prathap Senthil Syncfusion Team April 3, 2024 11:50 AM UTC

Hi Rob Clayton


Before proceeding with the reporting problem, we require some additional clarification from your end. Please share the below details to proceed further at our end.

  • Could you clarify if you're using any specific localization features in your application? Localization can affect how currencies are formatted and displayed based on the user's locale or language preferences.
  • What is the default language set in your system? Understanding the default language can provide insight into how currency symbols might be interpreted or displayed within your application.

Above-requested details will be very helpful in validating the reported query at our end and providing a solution as early as possible. Thank you for your understanding.

Regards,
Prathap S



RC Rob Clayton May 21, 2024 07:44 AM UTC

Hi Prathap


It is an out the box Blazor web app .net 8 and no specifics set around any localization, we intend this application to be across other currencies, so would ideally like to specify at component level what currency to display.


Thanks

Rob



RC Rob Clayton May 21, 2024 07:45 AM UTC

Also to mention, we require this for other components such as Pareto and Bar charts if you can also provide information on how to do this across the whole Syncfusion suite where financial data is involved



IG Ilamathi Govindaraj Syncfusion Team May 22, 2024 05:12 PM UTC

Hi Rob Clayton,


We have analyzed your query regarding how to specify currency format in Pareto and Bar charts. We have created a sample Pareto and Bar chart, specifying the currency format in axis labels using the LabelFormat property. The data label is formatted the same as the axis label. We have attached a sample and a screenshot for your reference. Please check the code snippet below.


Code Snippet:

 

<ChartPrimaryYAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Double" LabelFormat="C">

 


Screenshot:

Kindly revert us if you have any concerns.


Regards,

Ilamathi Govindaraj.


Attachment: ParetoAndBarChart_ca56d7ae.zip


RC Rob Clayton May 24, 2024 07:51 AM UTC

Hi

It is not the currency format, but the currency. If I apply your code snippet it is still showing currency as £, how can I make it $?


Thanks



DG Durga Gopalakrishnan Syncfusion Team May 27, 2024 12:14 PM UTC

Rob,


You can apply $ for axis labels using LabelFormat property. We have attached the modified sample for your reference. Please check with the below snippet and screenshot.


<SfChart>

    <ChartPrimaryYAxis LabelFormat="${value}"></ChartPrimaryYAxis>

</SfChart>



Sample : https://blazorplayground.syncfusion.com/rNrftILGpKVtszmx


Please revert us if you have any concerns.



RC Rob Clayton June 3, 2024 08:22 AM UTC

Hi Durga,


Ok perfect - thanks for your help.


Rob



DG Durga Gopalakrishnan Syncfusion Team June 3, 2024 10:22 AM UTC

Most welcome. Please get back to us if you need any further assistance. We are always happy in assisting you.


Loader.
Up arrow icon