AXE 0 Posted June 8, 2003 How do you take a number and separate each digit to make an array. for example, i want to change 21 into [2,1] Any help would be great Share this post Link to post Share on other sites
ralphwiggum 6 Posted June 8, 2003 i really have no time to help extensively, but here are some hints i can give. following are not tested and is pulled from my brain. 21/10 will return 2 21%(10*2) will return 1 "format" funtion returns string and make an array out of it. hopefully above method mught work. where bn880 when you need him? Share this post Link to post Share on other sites
AXE 0 Posted June 8, 2003 thanks I got it working now the only thing I need to know now is how to round numbers eg. change 3.432432 to 3 but also have 3.785645 return as 3. *edit never mind, fixed it Share this post Link to post Share on other sites
InqWiper 0 Posted June 9, 2003 Edit, never mind you fixed it Share this post Link to post Share on other sites
Leone 1 Posted June 9, 2003 And if you could post how you did it..... Share this post Link to post Share on other sites
raedor 8 Posted June 9, 2003 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_number = random 100 _rest = _number mod 1 _number = _number - _rest Share this post Link to post Share on other sites