Convert decimal to binary to hexadecimal and vice versa


posted by Tobias Weltner
11-10-2008

Downloads: 460
File size: 151 B
Views: 7,883

Embed
Convert decimal to binary to hexadecimal and vice versa
  1. $number = 12756576 
  2. [Convert]::ToString($number, 2) 
  3. [Convert]::ToString($number, 16) 
  4.  
  5. $binary = '1110111000010001' 
  6. [Convert]::ToInt64($binary, 2) 
Uses the .NET class "Convert" to convert numbers and easily turn decimals in binaries or hexadecimals in octals.
Copyright 2012 PowerShell.com. All rights reserved.