Sign in to follow this  
Followers 0
AreWe Onyett

Binary to (decimal) Integer Conversion or casting

4 posts in this topic

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

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :)

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0