ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
|
| 01 Feb 2013 09:38 PM |
| Could you explain more? (i.e. Where the number starts at, is there a pattern that you want, etc) |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
|
| 01 Feb 2013 09:42 PM |
| Roblox is not allowing me to post the solution. |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
|
| 01 Feb 2013 09:45 PM |
| Oh, as in just rounding it to a different decimal place. Don't know if there's a function for it, but perhaps you could convert the number to a string, and then find the number after the last place you want it to be able to go, and if it's >= 5, make the previous number++. That's about all I can think of. |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
|
| 01 Feb 2013 09:46 PM |
| And drop the rest off of the string of course. |
|
|
| Report Abuse |
|
|
|
| 01 Feb 2013 09:46 PM |
| Or that... Much more efficient than mine. |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
|
| 01 Feb 2013 10:04 PM |
local floor, ceil = math.floor, math.ceil function round(n, e) local rounded = n*10^e rounded = rounded%1 - .5 >= 0 and ceil(rounded) or floor(rounded) return rounded/10^e end
print(round(4.23466, 3)) |
|
|
| Report Abuse |
|
|