- Home /
Question by
brandonferr · Sep 18, 2011 at 05:35 PM ·
stringintconvertparse
Converting a string into int is rounding off
How do I convert a string into an int without it rounding my number. Right now converting my string "1316364916" is returning an int with a value of 1316365000. The code I am using is:
var time = "1316364916"; var convertTime = System.Int32.Parse(time);
AT THIS POINT convertTime is equal to 1316365000 and I need it to give me the correct value of 1316364916
Comment
Answer by Eric5h5 · Sep 18, 2011 at 05:49 PM
I used your code, and added "Debug.Log (convertTime);", and the result was "1316364916". So it doesn't round off normally; not sure what you're doing elsewhere that would cause that.