-
Oct 19th, 2021, 02:08 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Change decimal symbol to period not comma
I have a VB.NET application using a MySQL database.
My datagridview shows decimal values from the database with a comma as a symbol - I would like it to show a period (.). My regional settings are set to a period. However the DGV shows a comma. I have tried to change the DGV çolumn format to N2, but no change.
What am I missing?
Regards
-
Oct 19th, 2021, 02:12 AM
#2
Re: Change decimal symbol to period not comma
If you were working with numbers then they would be formatted as per your system settings. If that's not what you're seeing then you're almost certainly working with text. Where and how that might be happening is anyone's guess, given that you decided that asking us what you were doing wrong without showing us what you're doing would be a good idea. We should NEVER have to prompt you to show us the relevant code.
-
Oct 19th, 2021, 03:12 AM
#3
Thread Starter
Addicted Member
Re: Change decimal symbol to period not comma
Sorry my bad.
My dataset locale was different from my regional settings.
-
Oct 19th, 2021, 03:49 AM
#4
Re: [RESOLVED] Change decimal symbol to period not comma
That's interesting. The documentation for that property describes it thusly:
Gets or sets the locale information used to compare strings within the table.
That doesn't seem to relate you your issue so I would not have expected it to be relevant. The cells of the grid can only display text, so any value that isn't a String needs to be converted. If you had a DataColumn containing numeric values then I would have expected the grid to be the one doing that conversion, so the Locale of the DataSet would be irrelevant. What you're saying seems to suggest that the conversion is being done by the DataTable rather than the DataGridView and I'm not sure why that would be. I'd still be interested to know exactly how this data is being loaded.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|