Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Conversion  RSS feed

 
Javix Protocol
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to convert a decimal integer literal to octal and hexadecimal literal?
------------------
javix!
 
Jesper Ottosson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the decimal number 20 is:
0x14 in hex
024 in oct
so just prefix with 0x when you want hexadecimal and 0 when you want octal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!