Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 17778

PowerTip: Use PowerShell to Get Length of a Number

$
0
0

Summary:  Use Windows PowerShell to easily get the length of a number.

Hey, Scripting Guy! Question I want to know the length of a number, but when I use the Length property, it comes back as 1.
          How can I get the actual length?

Hey, Scripting Guy! Answer First convert the number to a string, and then get the length of the string:

(12345).tostring().length


Viewing all articles
Browse latest Browse all 17778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>