Skip to content
lsl.devlsl.devLSL Dev

llList2Float

function
Function syntax
float llList2Float(
  1. list src,// Source list containing the element of interest.
  2. integer index// Zero-based index of the entry.
);
Returns
float
Energy
10

Returns the float value at index in the list src. Returns 0.0 if the index is out of bounds or if the value cannot be type-cast.

Returns a float that is at index in src.

How to use
float result = llList2Float([], 0);
  • A string of hexadecimal notation (e.g. “0x12A”) or scientific notation (e.g. “6.2e+1”) will be parsed as float and contain the correct value1.
Example 1
9 collapsed lines
// Best viewed in Chat History (ctrl-h)
default
{
state_entry()
{
list my_list = ["a", 1, 2.0, <1,2,3>, <1,2,3,4>, llGetOwner()];
integer i = ~llGetListLength(my_list);
while (++i)
{
llOwnerSay("string=" + llList2String(my_list,i)
+ "\n integer=" + (string)llList2Integer(my_list,i)
+ "\n float=" + (string)llList2Float(my_list,i)
+ "\n vector=" + (string)llList2Vector(my_list,i)
+ "\n rot=" + (string)llList2Rot(my_list,i)
+ "\n key=" + (string)llList2Key(my_list,i) );
}
}
}

From the issue templates included by the wiki article:

  • SVC-798 (nf): Perform typecasting with all llList2* functions
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

  1. Correct with in the limitations of the float type. ↩