Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #40229

Re: Decimal numeric string to hexadecimal numeric string?

Newsgroups comp.lang.javascript
Date 2021-06-18 05:59 -0700
References <d210bffe-abab-448a-b36b-e1b27f3e25c0n@googlegroups.com>
Message-ID <233183ba-98dc-47d5-84f6-bd3beef1e793n@googlegroups.com> (permalink)
Subject Re: Decimal numeric string to hexadecimal numeric string?
From Scott Sauyet <scott@sauyet.com>

Show all headers | View raw


Jonas Thornvall wrote:

> prgNbr="11" 
> 
> parseInt(prgNbr); 
> prgNbr.toInteger(16); 
> 
> Is there a faster direct way to do the two last steps?

It might help if you told us what that was supposed to do, as it's not
working code.

If you want to parse `11` as though it is a hexadecimal string and 
thus should return the number 17, there's one answer.  If you want
to return the hexadecimal equivalent of the decimal number 11, namely
`b`, then there's a different answer.

What are you trying to do?

  -- Scott

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Decimal numeric string to hexadecimal numeric string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-17 14:28 -0700
  Re: Decimal numeric string to hexadecimal numeric string? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-06-17 21:38 -0700
    Re: Decimal numeric string to hexadecimal numeric string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-19 00:39 -0700
  Re: Decimal numeric string to hexadecimal numeric string? Scott Sauyet <scott@sauyet.com> - 2021-06-18 05:59 -0700
    Re: Decimal numeric string to hexadecimal numeric string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-19 00:45 -0700
      Re: Decimal numeric string to hexadecimal numeric string? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-06-19 11:42 +0100
        Re: Decimal numeric string to hexadecimal numeric string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-07-01 00:51 +0200
          Re: Decimal numeric string to hexadecimal numeric string? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-06-30 17:39 -0700
            Re: Decimal numeric string to hexadecimal numeric string? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-07-01 01:50 +0100
              Re: Decimal numeric string to hexadecimal numeric string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-07-01 12:46 +0200
            Re: Decimal numeric string to hexadecimal numeric string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-07-01 12:43 +0200

csiph-web