In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces how to convert numbers into strings in javascript. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
1. Use the plus sign "+" operator and the syntax "number +".
Var n = 123 typeof n = n + "; console.log (typeof n); / / return type is string
2. Use toString () method, syntax "numeric variable .toString ()".
Var a = 1.000 console.log var b = 0.0001 console.log var c = 1e Mui 1x console.log (b.toString ()); / / returns the string "1" (c.toString ()); / / returns the string "0.0001" (c.toString ()); / / returns the string "0.0001"
3. Convert a number to a decimal format string with toFixed (), toExponential (), or toPrecision ().
Var a = 10 position console.log (a.toFixed (2)); / / return the string "10.00" console.log (a.toFixed (4)); / / return the string "10.0000" about how to convert numbers into strings in javascript and that's it. I hope the above can be helpful and learn more. If you think the article is good, you can share it for more people to see.
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.