Q:

Change format of long variable?

Hello every one please give me suggestions, I'm trying to change string to long variable  like this but fail please let me know how to change :
I have a variable of long type
x = 1411833674288;

I'm converting this to string the it shows like this 1.411833674288E12
How can I change it back to 1411833674288
Thanks 

A:

Simply do like this:
Long to String
long x=1411833674288L; 

String longToString = Long.toString(x);//or you can use String.valueOf(x);

String back to Long
long y = Long.parseLong(longToString);

Edited
note that this value exceed the limit of long data type so you should use long within its range or put L or l at the end of the value as @Rustum said in the comment

