# Search the Community

Showing results for tags 'dec'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• General
• Announcements and Site News
• AutoIt v3
• AutoIt Help and Support
• AutoIt Technical Discussion
• AutoIt Example Scripts
• Scripting and Development
• Developer General Discussion
• Language Specific Discussion
• Operating System Deployment
• Windows Client
• Windows Server
• Office

### Categories

• AutoIt Team
• Beta
• MVP
• AutoIt
• Automation
• Databases and web connections
• Data compression
• Encryption and hash
• Games
• Hardware
• Information gathering
• Internet protocol suite
• Maths
• Media
• PDF
• Security
• Social Media and other Website API
• Windows
• Scripting and Development
• Operating System Deployment
• Windows Client
• Windows Server
• Office

• Forum FAQ
• AutoIt

### Calendars

• Community Calendar

• 0 Replies

• 0 Reviews

• 0 Views

Found 3 results

1. ## Failed color conversion to Hex

For some reason, I can't convert to Hex a Decimal color that has been calculated. For example, this works: Local \$iColor = 3310546 ConsoleWrite("\$iColor (dec): " & \$iColor & ", \$iColor (hex): " & Hex(\$iColor, 6) & @CRLF) giving the expected output: \$iColor (dec): 3310546, \$iColor (hex): 3283D2 But if I want to take an average of several colors, I have a problem. For example this doesn't work: \$iColor = (3310546 + 3310546) / 2 ConsoleWrite("\$iColor (dec): " & \$iColor & ", \$iColor (hex): " & Hex(\$i
2. ## Convert Dec to Binary - but Ones and Zeros

Hi All, Trying to convert a number to binary zeros and ones but I'm getting a result I don't understand and looks more like hex than binary. Here's my basic code: \$myNum = 11 \$myNumBin = Binary(\$myNum) MsgBox(0, "Binary result", \$myNumBin) What I want is "1011", what I get is 0x0B000000. Thanks!
3. ## Int, Dec and Number return incorrect results

Seems like Int function works incorrect sometimes. Int of binary data works fine on 1-byte data only. 2+ byte data always returns incorrect results. Int of 4-byte binary data and it's string representation: Int of 4-byte binary data returns bswap as result. Int64 of string representation of 4-byte binary data returns 32-bit signed integer. \$bin = Binary('0xff'); 1 BYTES MsgBox(524288, BinaryLen(\$bin) & ' ' & VarGetType(\$bin) & ' bytes', 'HEX: ' & \$bin & @LF & 'Int: ' & Int(\$bin) & @LF & 'Int32 <- String: ' & Int(String(\$bin), 1) &
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...