In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Most people do not understand the knowledge points of this article "javascript how to convert numbers to hexadecimal", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "javascript how to convert numbers into hexadecimal" article.
In javascript, you can use the toString () method of the Number object to convert a number to Hex (hexadecimal), which parses a specified numeric value and attempts to return a string representation of the specified cardinality (base) with the syntax of "specify numeric object .toString (16);".
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
In javascript, you can use the toString () method of the Number object to convert numbers to Hex (hexadecimal).
Example:
Var num = 255th console.log (num.toString (16)); / / output FF
Description:
The toString () method converts a Number object to a string and returns the result.
Syntax:
The NumberObject.toString (radix) parameter description radix is optional. Specifies the cardinality of the number so that it is an integer between 2 and 36. If this parameter is omitted, the cardinality of 10 is used. Note, however, that if the parameter is a value other than 10, the ECMAScript standard allows the implementation to return any value.
The toString () method parses its first parameter and attempts to return a string representation of the specified radix (cardinality).
For letters with a cardinality greater than 10, the letters represent numbers greater than 9. For example, for hexadecimal numbers (radix 16), use a through F.
If the cardinality is not specified, the preferred cardinality is assumed to be 10.
Var x parse 110m; alert (parseInt (xMagne2)); / / 6 = > parse 110alert in binary (parseInt (xmem8)); / / 72 = > parse 110alert in octal (parseInt (xMagol 16)) / / 272 = > parsing more than 110 in hexadecimal is about "how javascript converts numbers to hexadecimal". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about it, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.