473,409 Members | 1,943 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,409 software developers and data experts.

Best way to convert back a currency string into a number(int or long)?

Best way to convert back a currency string into a number(int or long)?

If I have, for example, $ 15.000,00 what is the best way to make it again an
int or long?

pls help!,
Juan.
Jul 21 '05 #1
2 5838
One way is to use Double.TryParse(). It gets you double data type value
though.

Eg:

double d;
Double.TryParse ("$15,000.00", NumberStyles.AllowCurrencySymbol |
NumberStyles.AllowThousands | NumberStyles.AllowDecimalPoint, null, out d);
Console.WriteLine (d);

"Juan" <ju*****************@ANTISPAMhotmail.com> wrote in message
news:e8**************@TK2MSFTNGP11.phx.gbl...
Best way to convert back a currency string into a number(int or long)?

If I have, for example, $ 15.000,00 what is the best way to make it again an
int or long?

pls help!,
Juan.

Jul 21 '05 #2
Thanx a lot!
"Shiva" <sh******@online.excite.com> escribió en el mensaje
news:eu**************@TK2MSFTNGP11.phx.gbl...
One way is to use Double.TryParse(). It gets you double data type value
though.

Eg:

double d;
Double.TryParse ("$15,000.00", NumberStyles.AllowCurrencySymbol |
NumberStyles.AllowThousands | NumberStyles.AllowDecimalPoint, null, out d); Console.WriteLine (d);

"Juan" <ju*****************@ANTISPAMhotmail.com> wrote in message
news:e8**************@TK2MSFTNGP11.phx.gbl...
Best way to convert back a currency string into a number(int or long)?

If I have, for example, $ 15.000,00 what is the best way to make it again an int or long?

pls help!,
Juan.

Jul 21 '05 #3

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

Similar topics

4
by: Leszek Klich | last post by:
Hello! I'm beginer programmer in QT (Linux and Windows). I have a problem. How to I can convert int variable to string? I searching function or tips but I can't found. Please help me. Leszek
4
by: Kay | last post by:
how to convert int to char * ? I have found this in a web site. However, it doesn't work even I change itoa to atoi including stdlib.h char str; int i=567; str=itoa(i, str, 10);
1
by: Juan | last post by:
Best way to convert back a currency string into a number(int or long)? If I have, for example, $ 15.000,00 what is the best way to make it again an int or long? pls help!, Juan.
7
by: Shankar | last post by:
How can we convert the integer values to byte arrays using C#.NET
7
by: wenmang | last post by:
what is format for sprintf to convert long long integer (64 bits) to string?
30
by: ceeques | last post by:
Hi I am a novice in C. Could you guys help me solve this problem - I need to convert integer(and /short) to string without using sprintf (I dont have standard libray stdio.h). for...
9
by: andrewanderson | last post by:
hi all members i would like to know how to convert int to char? can any tell me? this is what i did is it rite? #include <iostream.h> int main() { int num;
2
by: munjao1 | last post by:
i am passing an char ** argument and returning its value as int i am getting an error in doing that as cannot convert int to const char* what can i do?
3
by: anhc | last post by:
how to convert int to string ? help me !!!
8
by: puzzlecracker | last post by:
Is it possible, in a clean way, to convert int values too bool int i=10; bool b=(bool)i; instead of doing b=(i>0);
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.