I like to know how I can change (for example) the value 55.55 into 55,55. (The system in my country is using comma's instead of points)
I'm starting with a string with the value "55.55"
Then I will convert it to a double 55,55
Do I need the the system.Globalization namespace or is there just a simple solution?
If you are just going to use this format for display then it would be easy to do this:
dTemp = 55.55;
Hope this helps.
MCAD .Net, MCDBA
Please choose "Mark as Answer" for the post that leads you to a solution
Wouldn't it be easier to store the values as doubles with decimals, and then display values as a string with a comma?
I need to store the value in a sqldatabase
But can't you store them as decimals and then format them to strings whenever you have to pull them out and display them?
I did the following with replace
dim sTemp as string = 55.55
sTemp = sTemp replace (".",",")
dim dTemp as double = sTemp
If you are getting a string "55.55" & want to convert into "55,55" then best method is to use String.Replace(".",",").
But if you wan to store any decimal value into SQL DB then make the column as float in database
Convert your string value "55.55" directly to decimal, by using Convert.ToDecimal(some value)
Please mark helpful posts as "Answer"