Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************************
- Hi all! Need some help please!!
- Integer -> String -> List using digits as separators
- --> Append 0s to the front to create 4 digits
- For some reason, works fine except on 88, 89, 98 and 99. Not sure why it's not separating those two digits.
- Any ideas? As can be seen in output, 87 works just fine.
- Output:::
- Inventory Remaining: 87
- INVENTORY COUNT: 0|0|8|7
- Inventory Remaining: 88
- INVENTORY COUNT: 0|0|0|88
- Inventory Remaining: 89
- INVENTORY COUNT: 0|0|0|89
- ***************************************************/
- updateNumbers()
- {
- // faces 1 - 4
- itemCount = llGetInventoryNumber(INVENTORY_OBJECT);
- llSay(0, "Inventory Remaining: " + (string)itemCount);
- list numList = [];
- numList = llParseString2List((string)itemCount, [], ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]);
- if (llGetListLength(numList) > 4)
- {
- numList = ["9", "9", "9", "9"];
- }
- while (llGetListLength(numList) < 4)
- {
- numList = llListInsertList(numList, ["0"], 0);
- }
- llSay(0, "INVENTORY COUNT: " + llDumpList2String(numList,"|"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement