Wow. If I were paid by the line of code, I would certainly ditch Softshare and start pushing Gentran. With Softshare Delta, I would only get paid for one line: answer = round(value,2), not 59 as in the Gentran example below. A guy could go broke!
Art Douglas Lead Consultant Blackwater Network (877) 464-8915 -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of VANI RAMAKA Sent: Wednesday, November 12, 2008 9:04 PM To: [EMAIL PROTECTED]; edi list Subject: Re: [EDI-L] Round off price in Gentran 4.1 Hi, Long ago we implemented the logic for rounding off to 2 decimal places. Please go through the below code,wherever required make necesary changes. The input & output fileds should be string data type. // roundoff number var2 = #input field; strVar2 = strstr(var2, "."); lenVar2 = len(var2); IF ((strVar2 != -1) & (lenVar2 <=12)) THEN BEGIN diffVar2 = lenVar2 - strVar2 - 1; IF (diffVar2 = 1) THEN #output field = var2 + "0"; IF (diffVar2 = 2) THEN #output field = var2; IF (diffVar2 = 3) THEN BEGIN IF mid(var2,strVar2+3,1) >= "5" THEN BEGIN CNT_02=ATON(var2)+.005; NTOA(CNT_02,temp_2); pos=strstr(temp_2,"."); len1=len(temp_2); diff=len1-pos-1; IF pos != -1 THEN BEGIN IF diff = 1 THEN #output field = temp_2 + "0"; IF diff = 2 THEN #output field = temp_2; IF diff > 2 THEN #output field = left(temp_2,pos+3); END IF pos = -1 THEN #output field = temp_2 + ".00"; END IF mid(var2,strVar2+3,1) < "5" THEN #output field = left(var2,lenVar2-1); END IF (diffVar2 > 3) THEN BEGIN IF mid(var2,strVar2+3,1) >= "5" THEN BEGIN CNT_02=ATON(var2)+.005; NTOA(CNT_02,temp_2); pos=strstr(temp_2,"."); len1=len(temp_2); diff=len1-pos-1; IF pos != -1 THEN BEGIN IF diff = 1 THEN #output field = temp_2 + "0"; IF diff = 2 THEN #output field = temp_2; IF diff > 2 THEN #output field = left(temp_2,pos+3); END IF pos = -1 THEN #output field = temp_2 + ".00"; END IF mid(var2,strVar2+3,1) < "5" THEN #output field = left(var2,strVar2+3); END END Regards, Vani ________________________________ From: Narayanan Bharadwaj <[EMAIL PROTECTED]> To: edi list <[email protected]> Sent: Friday, 7 November, 2008 8:31:55 AM Subject: [EDI-L] Round off price in Gentran 4.1 Hello, we are using Gentran 4.1 windows, we are receiving price value with many decimal points, (for ex 28.11777777) from SAP and I need to convert it into two decimal points, (28.12 in this case) in our outbound map. Is there a "rounding off" option in Gentran mapping? Any clues in this regard are greatly welcome. Thanks NB. [Non-text portions of this message have been removed] Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ [Non-text portions of this message have been removed] ------------------------------------ ... Please use the following Message Identifiers as your subject prefix: <SALES>, <JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC> Job postings are welcome, but for job postings or requests for work: <JOBS> IS REQUIRED in the subject line as a prefix.Yahoo! Groups Links ------------------------------------ ... Please use the following Message Identifiers as your subject prefix: <SALES>, <JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC> Job postings are welcome, but for job postings or requests for work: <JOBS> IS REQUIRED in the subject line as a prefix.Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/EDI-L/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/EDI-L/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
