I got some weired problem while converting data type in ruby.
Here are some of the outputs that i got in console
0123 and enter gave me output 83
12345600.to_s #=> "12345600"
but
012345600.to_s gave me #=> "2739072" but i expect "012345600"
Seems like when there is 0 at the beginning of number the output is not as expected.
Can any one explain why this is happening? or provide me a solution so that i can get my expected output.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…