Math_Round

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Math_Round

Marc Pinnell-3
Looking for an elegant way to fix an old Lasso 3.6 page in Lasso 8.  
The old page has a long if/else statement to round minutes (decimal)  
of the hour up or down to the quarter hour. Thought I had it with  
Math_Round.

The manual states on page 486 [Math_Round: 3.1415926, 0.25] ➜ 3.25,  
but if you run that it doesn't work. You get 3.14.

Anyone have any thoughts on an easy, simple solution?

TIA,
Marc
--
Marc Pinnell
1027 Consulting
web << DESIGN >> print
PO Box 990872; Redding, CA 96099-0872
www.1027Consulting.com



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Math_Round

Fletcher Sandbeck
On 8/22/05 at 7:10 PM by [hidden email] (Marc Pinnell):

>Looking for an elegant way to fix an old Lasso 3.6 page in Lasso 8.  
>The old page has a long if/else statement to round minutes (decimal)  
>of the hour up or down to the quarter hour. Thought I had it with  
>Math_Round.
>
>The manual states on page 486 [Math_Round: 3.1415926, 0.25] ? 3.25,  
>but if you run that it doesn't work. You get 3.14.
>
>Anyone have any thoughts on an easy, simple solution?

You can do something like this:

[(integer: 3.14159 * 4.0)/4.0]
[(integer: 3.11111 * 4.0)/4.0]

And, if you always want it to show with the same precision:

[((integer: 3.14159 * 4.0)/4.0)->(setformat: -precision=2) &]
[((integer: 3.11111 * 4.0)/4.0)->(setformat: -precision=2) &]

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Lasso Product Specialist              [hidden email]
OmniPilot Software, Inc.                http://www.omnipilot.com

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Math_Round

Marc Pinnell-3
In reply to this post by Marc Pinnell-3
Awesome! Thanks Fletcher! I knew there was an easy way to do this,  
although I never would have come up with that!

Any idea if the math_round thing is a doc error or something else?

Marc


On Aug 22, 2005, at 7:41 PM, Fletcher Sandbeck wrote:

> On 8/22/05 at 7:10 PM by [hidden email] (Marc Pinnell):
>
>
>> Looking for an elegant way to fix an old Lasso 3.6 page in Lasso 8.
>> The old page has a long if/else statement to round minutes (decimal)
>> of the hour up or down to the quarter hour. Thought I had it with
>> Math_Round.
>>
>> The manual states on page 486 [Math_Round: 3.1415926, 0.25] ? 3.25,
>> but if you run that it doesn't work. You get 3.14.
>>
>> Anyone have any thoughts on an easy, simple solution?
>>
>
> You can do something like this:
>
> [(integer: 3.14159 * 4.0)/4.0]
> [(integer: 3.11111 * 4.0)/4.0]
>
> And, if you always want it to show with the same precision:
>
> [((integer: 3.14159 * 4.0)/4.0)->(setformat: -precision=2) &]
> [((integer: 3.11111 * 4.0)/4.0)->(setformat: -precision=2) &]
>
> [fletcher]
> --
> Fletcher Sandbeck                         [hidden email]
> Lasso Product Specialist              [hidden email]
> OmniPilot Software, Inc.                http://www.omnipilot.com
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>
>

--
Marc Pinnell
1027 Consulting
web << DESIGN >> print
PO Box 990872; Redding, CA 96099-0872
www.1027Consulting.com



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Math_Round

Fletcher Sandbeck
In reply to this post by Marc Pinnell-3
On 8/22/05 at 7:50 PM by [hidden email] (Marc Pinnell):

>Awesome! Thanks Fletcher! I knew there was an easy way to do this,  
>although I never would have come up with that!
>
>Any idea if the math_round thing is a doc error or something else?

I believe it's a doc error at this point.  We'll look into it.

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Lasso Product Specialist              [hidden email]
OmniPilot Software, Inc.                http://www.omnipilot.com

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Math_Round

Marc Pinnell-3
In reply to this post by Marc Pinnell-3
Thanks again. It is working wonderfully!

On Aug 22, 2005, at 7:58 PM, Fletcher Sandbeck wrote:

> On 8/22/05 at 7:50 PM by [hidden email] (Marc Pinnell):
>
>
>> Awesome! Thanks Fletcher! I knew there was an easy way to do this,
>> although I never would have come up with that!
>>
>> Any idea if the math_round thing is a doc error or something else?
>>
>
> I believe it's a doc error at this point.  We'll look into it.
>
> [fletcher]
> --
> Fletcher Sandbeck                         [hidden email]
> Lasso Product Specialist              [hidden email]
> OmniPilot Software, Inc.                http://www.omnipilot.com
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>
>

--
Marc Pinnell
1027 Consulting
web << DESIGN >> print
PO Box 990872; Redding, CA 96099-0872
www.1027Consulting.com



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage