Try X=INT(X*20+.5)/20
========================= Simon Verona Director Dealer Management Services Ltd T: 0845 686 2300 Sent from my iPhone On 11 Nov 2010, at 12:42, HARIPRASATH ILANGOVAN <[email protected]> wrote: > Hi, > > Please help to solve the roundoff problem. Let us take an example > VAR.1 = '52.6766', now the second character to the decimal value is 7 which > is greater than 5 so the result should be get like 52.65 and if the second > decimal point is 4 instead of 7 then the output should be like 52.60. So the > second decimal character should be roundoff between 0 and 5 only. I tried it > by using the substring function and i am unable to replace it to the second > character. Please help to proceed, coding part is given below for your > reference. > > PROGRAM TEST.SUBSTRINGS > > $INCLUDE GLOBUS.BP I_COMMON > $INCLUDE GLOBUS.BP I_EQUATE > VAR.1 = '52.6766' > VAR.2 = FIELD(VAR.1,".",2) > VAR.3 = SUBSTRINGS(VAR.2,2,1) > IF VAR.3 LT '5' THEN > VAR.3 = '0' > END ELSE > VAR.3 = '5' > END > * From here i am strucking, to proceed further > > END > > > > Thanks and Regards, > Hari Prasath. D.I > -- > Please read the posting guidelines at: > http://groups.google.com/group/jBASE/web/Posting%20Guidelines > > IMPORTANT: Type T24: at the start of the subject line for questions specific > to Globus/T24 > > To post, send email to [email protected] > To unsubscribe, send email to [email protected] > For more options, visit this group at > http://groups.google.com/group/jBASE?hl=en -- Please read the posting guidelines at: http://groups.google.com/group/jBASE/web/Posting%20Guidelines IMPORTANT: Type T24: at the start of the subject line for questions specific to Globus/T24 To post, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
