Reply
Honored Resident
AreWe Onyett
Posts: 5
0 Kudos

Binary to (decimal) Integer Conversion or casting

Can anyone tell me if there is any quick way to cast or convert a binary representation to a (decimal) integer value?

for example, my UI creates a text string in the form "1111" and I want to pass this to a function as an integer (decimal) value of 15 ....

Obviously I could code a function to do the conversion, but I was wondering if there is any built-in function, or method of casting the string to an integer value ... I haven't been able to find any information on this either here or in the LSL wiki ...

 

Thanks

 

Contributor
Cerise Sorbet
Posts: 2,476
0 Kudos

Re: Binary to (decimal) Integer Conversion or casting

Reply to AreWe Onyett - view message

Hi, the only native representations for LSL are decimal and hex. There is no parsing built in for binary or octal.

Rolig Loon
Posts: 23,819
Registered: ‎10-05-2009
0 Kudos

Re: Binary to (decimal) Integer Conversion or casting

Reply to AreWe Onyett - view message

Honored Resident
AreWe Onyett
Posts: 5
0 Kudos

Re: Binary to (decimal) Integer Conversion or casting

Reply to Rolig Loon - view message

Thanks Cerise, for confirming that I should stop looking for it .... and thanks Rolig for pointing me at that function and saving me having to create one :smileyhappy: