Added a space to the hex to make it easier to read.
Converting to Hex: uint(-214748364). toString(16).toUpperCase();
Starting Number: -214748364
Converted to UINT: 4080218932
toString(): F333 3334
Shown with unneeded padding: FFFF FFFF F333 3334
Converting back to int: int(parseInt("F3333334", 16));
parseInt(): 4080218932
int():-214748364
-Mark
-----Original Message-----
From: Saju Thankathurai [mailto:[email protected]]
Sent: Tuesday, October 14, 2014 10:41 PM
To: [email protected]
Subject: RE: Decimal to Hex conversion.
Using uint removes the padded 'f' . Is that correct or the value returned
from uint is correct?
--
Saju Thankathurai
Sent from my Samsung Galaxy Ace.
On 14 Oct 2014 22:01, "Kessler CTR Mark J" <[email protected]>
wrote:
> Well hex numbers work in the similar way a UINT works by treating it as
> all positive. Meaning...
>
>
> uint(-214748364). toString(16).toUpperCase();
>
>
> BTW this removes the padded "F"s.
>
>
> -Mark
>
> -----Original Message-----
> From: Saju Thankathurai [mailto:[email protected]]
> Sent: Tuesday, October 14, 2014 11:52 AM
> To: [email protected]
> Subject: Re: Decimal to Hex conversion.
>
> But Number("-214748364").toString(16).toUpperCase(); returned me only
> -CCCCCCC.
>
> How can we get the value FFFF FFFF F333 3334?
>
>
> --
> Regards
>
> Saju Thankathurai,
>
>
> On Tue, Oct 14, 2014 at 9:08 PM, Kessler CTR Mark J <
> [email protected]> wrote:
>
> > Oh didn't notice the negative sign.
> > Yes that changes it to the other way.
> >
> > -214,748,364 = FFFF FFFF F333 3334
> >
> > -Mark
> >
>