I am developing window phone 7 application in silverlight. I am new to the window phone 7 application. I have the long value in String format as follows
String A
You can't store a 15 digit integer since the maximum value for an integer is 2,147,483,647.
What's wrong with a long
-Value?
You could use TryParse() to get the long
-Value from yout user input:
String Am = AmountTextBox.Text.ToString();
long l;
Int64.TryParse(Am, out l);
It will return false
if the text can't be converted to long
, so it's pretty safe to use.
Otherwise, converting a long
to int
is a easy as
int i = (int)yourLongValue;
if you're happy with discarding MSBs and taking LSBs.