1 #include "Local.h" /* standard header file */
6 #pragma subtitle("subtitle - description ")
7 /********************************************************************/
10 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
11 /* Date: 13 Jun 1995 */
12 /* Programmer: CARL MCCALLA */
15 /* Abstract: Convert a character string fraction into a */
16 /* decimal (floating point) number. */
18 /* External Functions Called: */
21 /* Input: string - a pointer to a character string frac- */
23 /* Output: A decimal (floating point) number. */
25 /* Modification History: */
28 /********************************************************************/
31 float fracPart( char *string )
34 /***************************/
35 /* DECLARE LOCAL VARIABLES */
36 /***************************/
44 /*************************/
45 /* START BODY OF ROUTINE */
46 /*************************/
48 slash = strchr(string, '/');
50 memset(buf , '\0', 6);
51 strncpy( buf, string, slash-string);
53 numerator = (float) atoi(buf);
55 memset(buf , '\0', 6);
56 strcpy( buf, slash+1);
58 denominator = (float) atoi(buf);
60 return (numerator/denominator);