I hava temporary string, HHMM format, I need to get a decimal number, how can I do this?
eg.
'1221' = 1221
'0101' = 101
'0011' = 11
'0001' = 1
If the line starts with "0x", the radius is 16 (hexadecimal)
If the line starts with "0", the radius is 8 (octal).
But I want to treat it as a decimal regardless of whether it starts with 0 or 00 or 000.
additional:
thank you all.
I knew what you said, which makes me confuse the following:
var temp1 = 0300; var temp2 = '0300';
ParseInt (temp1,10) = 192; ParseInt (temp1,10) = 300;
so I doubt parseInt () and ask this question.
source
share