Rounding in QUIZ

Ole Hansen, ScanConsult oh@scanconsult.dk
Mon, 4 Aug 2003 18:22:35 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C35AB5.698E26D0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi Robert,
 
Below code, which is taken from one of our QTP's, should do the trick :
 
define price int*5 =  round(round(newprice * 2,-1,up) / 2,0) if roundfactor
= 5 &
                             else round(newprice,roundfactor,up)

HTH.
 
Mange hilsner / With kind regards
 
Ole Hansen
 
===========================================================
E-mail: oh@scanconsult.dk         Cell Phone: +45 4040 1150
===========================================================
ScanConsult IT-Partners ApS         Voice   : +45 8738 7474
Jegstrupvej 96A                     Fax     : +45 8738 7475
DK-8361 Hasselager         Support : support@scanconsult.dk
Denmark                    Sales   :   sales@scanconsult.dk
                 http://www.scanconsult.dk <http://www.scanconsult.dk/>

= ParaSuite :  A Suite of Air Cargo Handling solutions    =
= ParaSafe  :  A Suite of IT-Security solutions           =
= Partners  : Hewlett-Packard, Cognos, Microsoft and more =


-----Original Message-----
From: powerh-l-admin@cube.swau.edu [mailto:powerh-l-admin@cube.swau.edu] On
Behalf Of Robert Mills
Sent: 4. august 2003 17:43
To: PowerHouse Mail List (E-mail)
Subject: Rounding in QUIZ



Have just been asked if there is a way to make Quiz 'Round' an item to the
nearest 5 (five). 

Any suggestions? 

regards, 

Robert W.Mills 
Systems Development Manager 
Windsong Services 
(01689) 870622 x3005 


------=_NextPart_000_000A_01C35AB5.698E26D0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<TITLE>Message</TITLE>

<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D194141616-04082003>Hi=20
Robert,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D194141616-04082003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D194141616-04082003>Below=20
code, which&nbsp;is taken from one of our QTP's, should do the trick=20
:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D194141616-04082003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D194141616-04082003>define=20
price int*5&nbsp;=3D&nbsp;&nbsp;round(round(newprice * 2,-1,up) / =
2,0)&nbsp;if=20
roundfactor =3D 5&nbsp;&amp;<BR>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
else round(newprice,roundfactor,up)<BR></SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D194141616-04082003>HTH.</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>Mange hilsner / With kind=20
regards</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>Ole Hansen</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial=20
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>E-mail: <A=20
href=3D"mailto:oh@scanconsult.dk">oh@scanconsult.dk</A>&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Cell Phone: +45 4040=20
1150<BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>ScanConsult=20
IT-Partners ApS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Voice&nbsp;&nbsp; : +45 8738 7474<BR>Jegstrupvej=20
96A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Fax&nbsp;&nbsp;&nbsp;&nbsp; : +45 8738 7475<BR>DK-8361=20
Hasselager&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Support : <A=20
href=3D"mailto:support@scanconsult.dk">support@scanconsult.dk</A><BR>Denm=
ark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Sales&nbsp;&nbsp; :&nbsp;&nbsp; <A=20
href=3D"mailto:sales@scanconsult.dk">sales@scanconsult.dk</A><BR>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;=20
<A=20
href=3D"http://www.scanconsult.dk/">http://www.scanconsult.dk</A>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;=20
<BR>=3D ParaSuite :&nbsp; A Suite of Air Cargo Handling=20
solutions&nbsp;&nbsp;&nbsp; =3D<BR>=3D ParaSafe&nbsp; :&nbsp; A Suite of =
IT-Security=20
solutions&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
=3D<BR>=3D=20
Partners&nbsp; : Hewlett-Packard, Cognos, Microsoft and more =
=3D<BR></FONT></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr =
align=3Dleft><FONT=20
  face=3DTahoma size=3D2>-----Original Message-----<BR><B>From:</B>=20
  powerh-l-admin@cube.swau.edu [mailto:powerh-l-admin@cube.swau.edu] =
<B>On=20
  Behalf Of </B>Robert Mills<BR><B>Sent:</B> 4. august 2003 =
17:43<BR><B>To:</B>=20
  PowerHouse Mail List (E-mail)<BR><B>Subject:</B> Rounding in=20
  QUIZ<BR><BR></FONT></DIV>
  <P><FONT size=3D2>Have just been asked if there is a way to make Quiz =
'Round' an=20
  item to the nearest 5 (five).</FONT> </P>
  <P><FONT size=3D2>Any suggestions?</FONT> </P>
  <P><FONT size=3D2>regards,</FONT> </P>
  <P><FONT size=3D2>Robert W.Mills</FONT> <BR><FONT size=3D2>Systems =
Development=20
  Manager</FONT> <BR><FONT size=3D2>Windsong Services</FONT> <BR><FONT=20
  size=3D2>(01689) 870622 x3005</FONT> </P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000A_01C35AB5.698E26D0--