You trigonometry wiz kids just amaze me. ;-P
Bob
On Mar 3, 2011, at 11:57 AM, Alex Tweedly wrote:
>
> put 500 * round(x/500 + 0.499)
>
> -- Alex.
>
>
> On 03/03/2011 17:06, FlexibleLearning wrote:
>> Here's a poser for you all...
>>
>> How to round a number UP to the nearest 500?
>>
>
put 500 * round(x/500 + 0.499)
-- Alex.
On 03/03/2011 17:06, FlexibleLearning wrote:
Here's a poser for you all...
How to round a number UP to the nearest 500?
Hugh Senior
FLCo
___
use-livecode mailing list
use-livecode@lists.runrev.com
Plea
Yeah!
Minor tweak and it's working:
function roundUp500 theNumber
return trunc((theNumber-1)/500+1)*500
end roundUp500
Many thanks Mark and Brian. I love this group.
Hugh Senior
FLCo
On 3 mrt 2011, at 18:06, FlexibleLearning wrote:
> Here's a poser for you all...
>
Another variant:
trunc(n + (500 - (n mod 500)))
> Hi Hugh,
>
> function roundUp500 theNumber
> return trunc(theNumber/500+1)*500
> end roundUp500
>
> Seems to work.
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Softw
Hi Hugh,
function roundUp500 theNumber
return trunc(theNumber/500+1)*500
end roundUp500
Seems to work.
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553
New
Here's a poser for you all...
How to round a number UP to the nearest 500?
Hugh Senior
FLCo
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://l