i bet im not looking well but I cannot seem to find the answer to the following question:
i have a Datagrid which will display multiple columns with numbers, some will be above the thousand however i cannot seem to get it to display a decimal separator, I’m saving the numbers as a decimal value but it wont display it.
Thanks for taking the time to look at my question 🙂
Edit: this is about showing it in a datagrid in Windows Forms
Try setting the
Formatproperty on yourDataGridTextBoxColumn. The format you’re after is presumably"N0", which shows the thousands separator but no decimal places.Edit: If you want your numbers to always format consistently, irrespective of the culture of the machine on which the application is run, then you should set the
FormatInfoas well.For example, if you’re in Germany and always want the thousands separator to appear as a period (e.g.
12.345.678) rather than a comma (e.g.12,345,678), use:You might achieve better consistency by changing the culture for the entire application by setting the Application.CurrentCulture property on startup.