Derleek Posted September 1, 2008 Share Posted September 1, 2008 Is there a simple way to round up a number? only catch is I want to ALWAYS round up. Quote Link to comment Share on other sites More sharing options...
Derleek Posted September 1, 2008 Author Share Posted September 1, 2008 ok, found this chunk of code. if (X % 1 <.50 && X % 1 > 0) { result.value == round(X / 100) + 1 } else { result.value == round(X / 100) } } Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 1, 2008 Share Posted September 1, 2008 You don't need that - there is a built-in function to always round up (and there is one for rounding down as well) result.value = Math.ceil(x); Quote Link to comment Share on other sites More sharing options...
Derleek Posted September 1, 2008 Author Share Posted September 1, 2008 cool, thx. Thats what i was looking for Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.