0

I've got another issue, I have a SQL Server database in which I insert data using SqlCommand, one of the columns is numeric, but when I read this column back with this code:

 zcena1.Text = precti.GetDecimal(4).ToString();

the inserted button 123 is inserted as 123,00 (which is ok)

When I read it back it gives me back 123,00 is there any way to make it read like 123.00? Can I replace comma with dot?

2 Answers 2

2

You could try this:

zcena1.Text = precti.GetDecimal(4).ToString().Replace(',', '.');
Sign up to request clarification or add additional context in comments.

1 Comment

This approach works well for a specific case. But best practices should be adopted, so if you application is going to run at different countries of continental Europe, you'll want to keep the comma instead of the dot. And that where the localization shows it's strength
1

you should try working localized, look for

Decimal.Parse (String, IFormatProvider) 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.