ListToWholeNumbers
From Second Life Wiki
| Languages: |
English |
| LSL Portal | | | Functions | | | Events | | | Types | | | Operators | | | Constants | | | Flow Control | | | Script Library | | | Tutorials |
Contents |
Description
Function: list ListToWholeNumbers( list mylist );Takes a list and truncates each float in the list so that it is a whole number.
Returns a list that contains the elements of myList but with the float elements having their fractional parts removed.
| • list | mylist |
See also: Lists
Specification
list ListToWholeNumbers(list myList) { integer ListLength = llGetListLength(myList); integer i = -1; while (++i < ListLength) { if(TYPE_FLOAT == llGetListEntryType(myList, i)) { float f = llList2Float(myList, i); if(llFabs(f) < 0x1000000)//can it have an fpart? f = (integer)f; myList = (myList = []) + llListReplaceList(myList, (list)f, i, i); } } return myList; }

