## rounding in a clip

Expand Messages
• I wrote a week or two ago seeking a solution to a problem I had. The list has always been most helpful, but for some reason this time I got zero responses, so
Message 1 of 11 , Oct 3, 2004
I wrote a week or two ago seeking a solution to a problem I had. The
list has always been most helpful, but for some reason this time I got
zero responses, so perhaps I asked the wrong way. So I guess I will try
something simpler and then piece it together.

If say I take the number 395, I want to divide it by 60 ... and I get
6.58333333
I want to round this down to 6 (ie toss the remainder).
Is there a math function to do this?
I suppose if I made it a string I could toss everything including and
after the period.

I was using:
^!Set %name_variable%=^\$Calc(^%seconds%/60;0)\$

This seems to create rounding with anything .5 or greater going up.
Nothing in help I am finding documents this.

I also find a ROUND function in math help, but again no explaination of
how it works. How might this compare to the rounddown() function in
excel for example? That program offers roundup(), rounddown() and round().

Am I missing something in help?
Is there a way to simplify what I am doing?
• ... Not sure, the math functions aren t really explained, but I think ROUND() does what you want. It seems to round to the closest integer with a preference
Message 2 of 11 , Oct 3, 2004
At 21:41 2004-10-03, Don Passenger wrote:

>If say I take the number 395, I want to divide it by 60 ... and I get
>6.58333333
>I want to round this down to 6 (ie toss the remainder).
>Is there a math function to do this?

Not sure, the math functions aren't really explained, but I think ROUND()
does what you want. It seems to round to the closest integer with a
preference for even numbers. I.e. 2.5 is rounded to 2 and 3.5 is rounded to 4.

^!Info ^\$Calc(ROUND(395/60))\$

Lotta
• I didn t see this part. ... I don t know Excel, but I have a hunch that CEIL and FLOOR correspond to roundup() and rounddown()... Lotta
Message 3 of 11 , Oct 3, 2004
I didn't see this part.

>I also find a ROUND function in math help, but again no explaination of
>how it works. How might this compare to the rounddown() function in
>excel for example? That program offers roundup(), rounddown() and round().

I don't know Excel, but I have a hunch that CEIL and FLOOR correspond to
roundup() and rounddown()...

Lotta
• Thanks for the quick response Lotta, I am finding an additional problem. It appears that these math functions are only available via control+e and not in
Message 4 of 11 , Oct 3, 2004
Thanks for the quick response Lotta, I am finding an additional
problem. It appears that these math functions are only available via
control+e and not in clips?

floor(395/60)=6
so this does work ... but how do I get it to go in a clip ... if I can?

loro wrote:

> I didn't see this part.
>
>
>>I also find a ROUND function in math help, but again no explaination of
>>how it works. How might this compare to the rounddown() function in
>>excel for example? That program offers roundup(), rounddown() and round().
>
>
> I don't know Excel, but I have a hunch that CEIL and FLOOR correspond to
> roundup() and rounddown()...
>
> Lotta
>
>
>
>
>
>
>
>
>
>
>
>
>
• Don, If you subtract .5 from the number first (possibly .4999) it would be the same as rounding down. Test ^!set %x%=^\$Calc(395/60-.49999;0)\$ ^!Info
Message 5 of 11 , Oct 3, 2004
Don,
If you subtract .5 from the number first (possibly .4999) it would be the
same as rounding down.

Test
^!set %x%=^\$Calc(395/60-.49999;0)\$
^!Info ^395/60=^%x%
^!set %x%=^\$Calc(360/60-.49999;0)\$
^!Info 360/60=^%x%
^!set %x%=^\$Calc(359.999/60-.49999;0)\$
^!Info 359.999/60=^%x%
Warner

----- Original Message -----
From: "Don Passenger" <dpasseng@...>
To: <ntb-clips@yahoogroups.com>
Sent: Sunday, October 03, 2004 1:18 PM
Subject: Re: [Clip] rounding in a clip

>
> Thanks for the quick response Lotta, I am finding an additional
> problem. It appears that these math functions are only available via
> control+e and not in clips?
>
> floor(395/60)=6
> so this does work ... but how do I get it to go in a clip ... if I can?
>
> loro wrote:
>
>> I didn't see this part.
>>
>>
>>>I also find a ROUND function in math help, but again no explaination of
>>>how it works. How might this compare to the rounddown() function in
>>>excel for example? That program offers roundup(), rounddown() and
>>>round().
>>
>>
>> I don't know Excel, but I have a hunch that CEIL and FLOOR correspond to
>> roundup() and rounddown()...
>>
>> Lotta
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
>
>
>
>
>
>
Don,
If you subtract .5 from the number first (possibly .4999) it would be the
same as rounding down.

Test
^!set %x%=^\$Calc(395/60-.49999;0)\$
^!Info ^395/60=^%x%
^!set %x%=^\$Calc(360/60-.49999;0)\$
^!Info 360/60=^%x%
^!set %x%=^\$Calc(359.999/60-.49999;0)\$
^!Info 359.999/60=^%x%
Warner

----- Original Message -----
From: "Don Passenger" <dpasseng@...>
To: <ntb-clips@yahoogroups.com>
Sent: Sunday, October 03, 2004 1:18 PM
Subject: Re: [Clip] rounding in a clip

>
> Thanks for the quick response Lotta, I am finding an additional
> problem. It appears that these math functions are only available via
> control+e and not in clips?
>
> floor(395/60)=6
> so this does work ... but how do I get it to go in a clip ... if I can?
>
> loro wrote:
>
>> I didn't see this part.
>>
>>
>>>I also find a ROUND function in math help, but again no explaination of
>>>how it works. How might this compare to the rounddown() function in
>>>excel for example? That program offers roundup(), rounddown() and
>>>round().
>>
>>
>> I don't know Excel, but I have a hunch that CEIL and FLOOR correspond to
>> roundup() and rounddown()...
>>
>> Lotta
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
>
>
>
>
>
>
• ... I guess my first reply hasn t rolled in yet, the one about ROUND. yahoogroups is slow again. ^!Info ^\$Calc(ROUND(395/60))\$ You can do the same with CEIL
Message 6 of 11 , Oct 3, 2004
Don Passenger wrote:
>Thanks for the quick response Lotta, I am finding an additional
>problem. It appears that these math functions are only available via
>control+e and not in clips?
>
>floor(395/60)=6
>so this does work ... but how do I get it to go in a clip ... if I can?

I guess my first reply hasn't rolled in yet, the one about ROUND.
yahoogroups is slow again.

^!Info ^\$Calc(ROUND(395/60))\$

You can do the same with CEIL and FLOOR, but I think ROUND is what you're
looking for.

Lotta
• ... Sheesh, I read sloppy. You said round DOWN. Then it s FLOOR you want. ^!Info ^\$Calc(FLOOR(395/60))\$ Lotta
Message 7 of 11 , Oct 3, 2004
Me said:
>I think ROUND is what you're looking for.

Sheesh, I read sloppy. You said round DOWN. Then it's FLOOR you want.

^!Info ^\$Calc(FLOOR(395/60))\$

Lotta
• On Sunday, Oct 03, 2004 Don Passenger wrote regarding rounding in a clip ; ... Hi Don, As an experiment I tried this and it seems to work: ^!Set
Message 8 of 11 , Oct 3, 2004
On Sunday, Oct 03, 2004
Don Passenger wrote regarding "rounding in a clip";

> It appears that these math functions are only available via
> control+e and not in clips?
>
> floor(395/60)=6
> so this does work ... but how do I get it to go in a clip ... if I can?

Hi Don,

As an experiment I tried this and it seems to work:

^!Set %value%=^\$CALC(FLOOR(395/60))\$
^%value%

Of course you'll have to modify it to your specific needs.

HTH
Ben
• I did get your first post after your second. It appears that you simply put it inside the calc. I have to say the help on these two things (math functions
Message 9 of 11 , Oct 3, 2004
I did get your first post after your second. It appears that you simply
put it inside the calc. I have to say the help on these two things
(math functions and calc) aren't all that explanative. Floor does
appear to do it and by putting it in a calc, then I should be rolling.

The other answer was interesting. I never thought of it, but
subtracting .49999 would get one the same result. Seems to make sense.

loro wrote:

> Me said:
>
>>I think ROUND is what you're looking for.
>
>
> Sheesh, I read sloppy. You said round DOWN. Then it's FLOOR you want.
>
> ^!Info ^\$Calc(FLOOR(395/60))\$
>
> Lotta
• Don, Well, your original question WAS overwhelming ;-) This post (and what follows it) could be of some help:
Message 10 of 11 , Oct 3, 2004
Don,

Well, your original question WAS overwhelming ;-)

This post (and what follows it) could be of some help:

http://groups.yahoo.com/group/ntb-clips/message/10156

Larry Thomas dug into calculations with NoteTab a while back. He
lives on...

For your specific situation you could look into MOD maybe, it gives
you the remainder: 395 MOD 60 = 35... I really cannot help you with
the specific use of all the functions.

Hugo
• ... Don, I recall you saying you always want to round down to a whole number. The following 2 operators appear to always give the same result by rounding down.
Message 11 of 11 , Oct 4, 2004
Don Passenger wrote:
> I wrote a week or two ago seeking a solution to a problem I had. The
> list has always been most helpful, but for some reason this time I got
> zero responses, so perhaps I asked the wrong way. So I guess I will try
> something simpler and then piece it together.
>
> If say I take the number 395, I want to divide it by 60 ... and I get
> 6.58333333
> I want to round this down to 6 (ie toss the remainder).
> Is there a math function to do this?
> I suppose if I made it a string I could toss everything including and
> after the period.

Don,

I recall you saying you always want to round down to a whole number.
The following 2 operators appear to always give the same result by
rounding down.

^\$Calc(FLOOR(395/60))\$
^\$Calc(INT(395/60);0)\$

hrs
Your message has been successfully submitted and would be delivered to recipients shortly.