Re: round and statRound

2005-04-13 Thread Jeanne A. E. DeVoto
At 8:28 PM +0100 4/13/05, David Burgun wrote: no, use: trunc(1.5)+1 Thanks! There should be a mention of this on the round and statRound documentation pages! There's a See Also link to the cookbook recipe for "Rounding a number up to a ceiling". (Or at least there used to be.) The

Re: round and statRound

2005-04-13 Thread Mark Schonewille
Hi, While we were talking this over on ChatRev, I came up with this one-line solution: function f2 x return trunc(x)+(itemoffset((x is an integer),"true,false")-1) end f2 (mind line-wraps). If you want to join the discussion, download a client at

Re: round and statRound

2005-04-13 Thread David Burgun
yeah, I solved it with: if Value is not an integer then put truc(Value + 1) into value end if Cheers Dave What about? put ceil(25.0) = 26, not the indended result. Try: function ceil pVal if pVal mod trunc(pVal) = 0 then return pVal return trunc(pVal)+1 end function -Chipp Alex Tweedly wrote:

Re: round and statRound

2005-04-13 Thread Björnke von Gierke
On Apr 13 2005, at 21:40, Chipp Walters wrote: What about? put ceil(25.0) = 26, not the indended result. Try: function ceil pVal if pVal mod trunc(pVal) = 0 then return pVal return trunc(pVal)+1 end function -Chipp Alex Tweedly wrote: Alex Tweedly wrote: Don't think there's one built-in. functi

Re: round and statRound

2005-04-13 Thread Chipp Walters
What about? put ceil(25.0) = 26, not the indended result. Try: function ceil pVal if pVal mod trunc(pVal) = 0 then return pVal return trunc(pVal)+1 end function -Chipp Alex Tweedly wrote: Alex Tweedly wrote: Don't think there's one built-in. function ceil pVal return ceil(pVal)+1 end ceil Sorr

Re: round and statRound

2005-04-13 Thread Dennis Brown
sorry, that should be trunc(pVal+1) On Apr 13, 2005, at 3:36 PM, Dennis Brown wrote: How does this work with even values 1,2,3 you would need to add just less than 1 or test that the number and the trunc are not the same function ceil pVal if trunc(pVal) = pVal then return pVal else return tru

Re: round and statRound

2005-04-13 Thread Frank D. Engel, Jr.
of 2; is this what you want? Consider: function ceil x return trunc(x + 0.5) end ceil On Apr 13, 2005, at 3:28 PM, David Burgun wrote: no, use: trunc(1.5)+1 Thanks! There should be a mention of this on the round and statRound documentation pages! Cheers Dave

Re: round and statRound

2005-04-13 Thread Frank D. Engel, Jr.
mention of this on the round and statRound documentation pages! Cheers Dave ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution

Re: round and statRound

2005-04-13 Thread Dennis Brown
How does this work with even values 1,2,3 you would need to add just less than 1 or test that the number and the trunc are not the same function ceil pVal if trunc(pVal) = pVal then return pVal else return trunc(pVal)+1 end if end ceil Dennis On Apr 13, 2005, at 3:24 PM, Alex Tweedly wrote: A

Re: round and statRound

2005-04-13 Thread David Burgun
no, use: trunc(1.5)+1 Thanks! There should be a mention of this on the round and statRound documentation pages! Cheers Dave ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution

Re: round and statRound

2005-04-13 Thread Alex Tweedly
Alex Tweedly wrote: Don't think there's one built-in. function ceil pVal return ceil(pVal)+1 end ceil Sorry - I meant return trunc(pVal)+1 -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.

Re: round and statRound

2005-04-13 Thread Björnke von Gierke
no, use: trunc(1.5)+1 On Apr 13 2005, at 21:10, David Burgun wrote: Hi, I just want to always round a number up, for instance 25.1 25.001 25.3 25.5 25.9 should all be rounded up to 26. The round and statFunctions don't seem to do this, is there a function that does? Thanks Dave

Re: round and statRound

2005-04-13 Thread Alex Tweedly
David Burgun wrote: Hi, I just want to always round a number up, for instance 25.1 25.001 25.3 25.5 25.9 should all be rounded up to 26. The round and statFunctions don't seem to do this, is there a function that does? Don't think there's one built-in. function ceil pVal return ceil(pV

round and statRound

2005-04-13 Thread David Burgun
Hi, I just want to always round a number up, for instance 25.1 25.001 25.3 25.5 25.9 should all be rounded up to 26. The round and statFunctions don't seem to do this, is there a function that does? Thanks Dave ___ use-revolution mailing list