SUBROUTINE SCVTJ (JVALUE,PICTUR,STRING) C***************************************************************************** C C Description : Routine to convert an integer value to a string according C to a given lay-out (picture-string) C C Arguments : JVALUE = INTEGER*4 value to be converted C C PICTUR = STRING containing the picture code characters: C 9 - numeric position C Z - zero-suppressed numeric position (for non- C exponential notation only) C S - position of sign C for non-exponential notation: C S followed by a 9 or as the last character C of the picture-string indicates fixed sign, C S followed by a Z indicates floating sign C for exponential notation: C S must be the first character in the picture C otherwise it will cause unpredictable results C E - indicates exponential notation (must be the C last char. in the picture-string, if present) C C The last character in the picture-string, C other than 9,Z or S , and before the eventual E, C will be treated as the decimal point. C The picture-string may be max. 39 characters long. C C STRING = STRING returning the value-string C In case of an invalid picture-string or a picture- C string too small to reproduce the number in JVALUE, C the resultstring has a minimum length of 12 charac- C ters (11 number characters + zero-byte). C C Author : T.Pijl C AKZO PHARMA, Oss Holland C dept. SDA C C Version : V1.0 Date : 4-jan-83 C C Module name : SCVTJ.FOR C C Package : C C Compilation/Linking : C C Updates : name version C C description : C C***************************************************************************** C BYTE PICTUR(1),STRING(1),HSTR(50) INTEGER*4 JVALUE C DOUBLE PRECISION D C D=JVALUE CALL SCVTD(D,PICTUR,HSTR) ! convert integer to string C LS=LEN(HSTR) ! change floating default picture to integer default IF (PICTUR(LEN(PICTUR)).NE.'E' .AND. 1 LS.GT.8 .AND. HSTR(LS-3).EQ.'E') 2 CALL SCVTD(D,'ZZZZZZZZZZ9',HSTR) C CALL SCOPY(HSTR,STRING) RETURN END