Have you looked at the ROUND() and TRUNC() functions? Make sure you set your PRECISION to the number of places of accuracy that you need.
Jim From: [email protected] [mailto:[email protected]] On Behalf Of HARIPRASATH ILANGOVAN Sent: Thursday, November 11, 2010 4:43 AM To: [email protected] Subject: T24 : Replace function 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
