473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

how to force convert string to long/double

Hi, I am new here. Please forgive me if I ask some question already got
answered. I do search forum first but I did not find the answer.
here is my question, in VB you can convert a string to long by CLng or to
double by CDbl. How I can do it in C#?
I tried (long)MyStringVariable and MyStringVariable as long, neither work.
also, what the data type in C# for Date of VB?

Thank you
Wes
Nov 17 '05 #1
1 50900
long lValue = long.Parse(string);

"wesbird" <we*****@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
Hi, I am new here. Please forgive me if I ask some question already got
answered. I do search forum first but I did not find the answer.
here is my question, in VB you can convert a string to long by CLng or to double by CDbl. How I can do it in C#?
I tried (long)MyStringVariable and MyStringVariable as long, neither work. also, what the data type in C# for Date of VB?

Thank you
Wes

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: michi | last post by:
Hello How can I convert a string to double with a decimal point as seperator? ***CODE**** strNumber ="12.00" dblDouble = Cdbl(strNumber) ****
8
by: kathy | last post by:
I can not find something like atof() which can convert string to double. Can anyone help me?
10
by: zelyal | last post by:
I got : An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Additional information: Input string was not in a correct format. at execution of simple line: double...
6
by: Jay | last post by:
I need to convert from a string a double that is followed by a scaling character (k means *1e3, M=*1e6, etc) then apply the scaling character. Example: "-1.345k #comment" I know roughly how...
15
by: shiniskumar | last post by:
How to convert string to double? Ive got a double variable dTot; its value is 5.037717235E7 when i did FreemarkerTools.formatDecimal(dTot) i got it as string "50377172.35". now i want to...
4
by: Seesharp2008 | last post by:
Hi every one! I have a funny problem , I have this piece of code which should convert a string to double and again Double to string. try { string str = "98.22"; ...
1
by: chaitukdr | last post by:
Hi, I tried to convert string value 1.10 to double like double val=convert.todouble("1.10"); only 1.1 is given as result instead of 1.10 plz suggest me with a proper answer
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.