Hi Claudine:
One question, should 2.209 round to 2.20 (rate = 0.16, absolute difference =
0.009) rather than 2.25 (rate = 0.17, absolute difference = 0.041)? or do
you always want to round "up" the original number. Same scenario for 2.170,
should it round "down" to 2.15 or "up" to 2.20?
Javier,

Javier Valencia, PE
President
Valencia Technology Group, L.L.C.
14315 S. Twilight Ln, Suite #14
Olathe, Kansas 66062-4578
Office (913)829-0888
Fax (913)649-2904
Cell (913)915-3137
================================================
Attention:
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material.  Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the sender and
delete the material from all system and destroy all copies.
======================================================

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Claudine
Robbins
Sent: Monday, June 06, 2005 11:16 PM
To: RBG7-L Mailing List
Subject: [RBG7-L] - Rounding Puzzler


I know there is a brainiac out there who knows the answer.  It eludes
me...

I get numbers, such as 2.209; 2.170, etc...

I need to round them to the next number which, after subtracting 1.40 is
evenly divisible by 5, i.e. 2.209 would round to 2.25 (vrate should be
.17).  2.170 correctly rounds to 2.20 (vrate is .16).

This is what I have so far, but as you can see, it doesn't work
reliably:

SET VAR VBASE = 1.40
SET VAR VRESPONSE = 2.209
SET VAR vmod = (MOD(.vresponse,.05))
IF vmod > 0 THEN
   SET VAR vresponse = (ROUND(.vresponse,1))
ENDIF
SET VAR vrate = ((.vresponse - .vbase)/5)
Show var vrate yields .16 should be .17

With vresponse = 2.170, vrate is correctly .16

TIA,

Claudine :)

--- RBG7-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================

Reply via email to