Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

i am developing a desktop application with c#, in my application there is a float numbers.

for example; 3,2
Now, what i want is "3,2" to "3.2" .. I want '.' instead of ',' i know there is an option in windows but, i want to this in my code.

Thanks,
Posted
Comments
Xeshan Ahmed 14-Oct-11 9:14am    
do you want to get input in your textbox ??
Xeshan Ahmed 14-Oct-11 9:14am    
please rephrase your question in understandable form
hilmisu 14-Oct-11 9:16am    
i am going to send these values to sql. sql are not accept the coma ',' so, i have to use dot '.' as a seperator between integer and float part of the values

1 solution

Use CultureInfo.InvariantCulture[^]
C#
double d = 2.0;
string str = d.ToString(CultureInfo.InvariantCulture);
 
Share this answer
 
Comments
hilmisu 14-Oct-11 9:32am    
Thanks! works perfect.
Simon Bang Terkildsen 14-Oct-11 9:38am    
My pleasure
Espen Harlinn 15-Oct-11 4:24am    
Good answer :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900