As you correctly said, the value is too big for an integer. It really depends on what you are intending to do with the resulting number. There is no built-in type which can handle an integer with that many digits. One possibility is to use a type double, which will give an approximation.
1 2
|
AnsiString a = "123401278034987120478102873401982734";
double d = a.ToDouble();
|
The variable d will have the value of about 1.23401278034987e+35 (using scientific notation).
If you really need the full precision you will need to use some external bignum library.
edit Sorry, I skipped past the CSpinEdit. I've not used that and am not familiar with it. It looks like what you are attempting to do is not possible with TCSpinEdit and a number as large as that. The problem is not in the conversion, but in the TCSpinEdit component itself, it isn't suitable for use with a number having that many digits as the TCSpinEdit->Value is a long int.
One other comment. It probably won't help here, but it's useful to know. To convert an AnsiString to an ordinary c-string, use the
.c_str()
member function. Example:
1 2
|
AnsiString a = "12348765";
int x = atoi(a.c_str());
|