flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kessler CTR Mark J <mark.kessler....@usmc.mil>
Subject RE: Decimal to Hex conversion.
Date Tue, 14 Oct 2014 15:35:05 GMT
214,748,364 = 0xCCCCCCC

-Mark

-----Original Message-----
From: Saju Thankathurai [mailto:sathikeshjith@gmail.com]
Sent: Tuesday, October 14, 2014 10:49 AM
To: users@flex.apache.org
Subject: Re: Decimal to Hex conversion.

Hi,

I need to convert a larger value *-214748364  *to hexa decimal value.

Tried using the below code

Number(*-214748364*).toString(16).toUpperCase();

It returned *-CCCCCCC    *But the same input in calculator returned me
*FFFFFFFFF3333334*

My Question is, Which is correct? *-CCCCCCC or **FFFFFFFFF3333334 ?*

--
Regards


Saju Thankathurai,


On Thu, Oct 2, 2014 at 2:10 PM, Javier Guerrero García <javi.gg@gmail.com>
wrote:

> OMFG! :D
>
> Syntax error: "user", "know" and "hex values" found in the same sentence.
> Expected "doesn't" :)
>
> On Thu, Oct 2, 2014 at 2:22 AM, Saju Thankathurai <sathikeshjith@gmail.com
> >
> wrote:
>
> > Its a desktop application. Some users know hex values. So they start
> typing
> > hex values in one column of datagrid. Based on the hex values we need to
> > show its corresponding scaled value ie decimal value in other column and
> > vice versa.
> >
> > --
> > Saju Thankathurai
> >
> > Sent from my Samsung Galaxy Ace.
> > On 1 Oct 2014 21:25, "Gordon Smith" <gsmithsf@hotmail.com> wrote:
> >
> > > A requirement for what kind of application for what kind of user? I've
> > > never met a user that would understand fractional hex values which is
> why
> > > I'm curious.
> > >
> > > - Gordon
> > >
> > > > On Sep 30, 2014, at 7:58 PM, "Saju Thankathurai" <
> > > sathikeshjith@gmail.com> wrote:
> > > >
> > > > Actually it was a requirement that's why i asked. Thanks for your
> > > answers.
> > > >
> > > >
> > > > --
> > > > Regards
> > > >
> > > > Saju Thankathurai,
> > > >
> > > >
> > > > On Wed, Oct 1, 2014 at 5:09 AM, Frédéric THOMAS <
> > webdoublefx@hotmail.com
> > > >
> > > > wrote:
> > > >
> > > >> Hi gordon, really, I didn't want, just because some else wanted and
> I
> > > >> answered giving a mathematical uncorrected solution, I pushed the
> > thing
> > > a
> > > >> little more deeply and found I was even totally wrong and then
> wanted
> > to
> > > >> give the right answer, for himself, I don't know what was his goal
> > > really.
> > > >>
> > > >> Frédéric THOMAS
> > > >>
> > > >>> Subject: Re: Decimal to Hex conversion.
> > > >>> From: gsmithsf@hotmail.com
> > > >>> Date: Tue, 30 Sep 2014 09:17:18 -0700
> > > >>> To: users@flex.apache.org
> > > >>>
> > > >>> Converting decimal numbers with fractional parts to hex is rather
> > > >> unusual. I'm curious why you want to do this.
> > > >>>
> > > >>> - Gordon
> > > >>>
> > > >>>> On Sep 29, 2014, at 4:23 AM, "Saju Thankathurai" <
> > > >> sathikeshjith@gmail.com> wrote:
> > > >>>>
> > > >>>> Hi,
> > > >>>>
> > > >>>> How can we convert a decimal value to Hex value?
> > > >>>>
> > > >>>> I need to convert *1345.4567 *value to HEX value. I used the
below
> > > >> code to
> > > >>>> convert decimal values to Hex,
> > > >>>>
> > > >>>> hexVal.text = uint(scaledVal.text).toString(16).toUpperCase();
> > > >>>>
> > > >>>>
> > > >>>> Below code to convert from Hex to decimal.
> > > >>>> var texts:String = "0x"+hexVal.text;
> > > >>>> scaledVal.text = uint(texts).toString(10);
> > > >>>>
> > > >>>>
> > > >>>> The value 1345 is converted to HEX without any issues. But
after
> the
> > > >>>> decimal part, it is not converting.
> > > >>>>
> > > >>>> Could some one give inputs on this conversion.
> > > >>>>
> > > >>>>
> > > >>>> --
> > > >>>> Regards
> > > >>>> Saju Thankathurai,
> > > >>
> > > >>
> > >
> >
>
Mime
View raw message