|
From: Jose M. <ho...@us...> - 2005-06-22 22:52:50
|
Update of /cvsroot/ganc/ganc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5536/src Modified Files: main.c parser_stuff.c Log Message: Added stuff to detect and use the "decimal character" of the current locale Index: parser_stuff.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/parser_stuff.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** parser_stuff.c 8 Mar 2004 21:25:47 -0000 1.19 --- parser_stuff.c 22 Jun 2005 22:52:42 -0000 1.20 *************** *** 99,104 **** --- 99,121 ---- } parse_result; //int yydebug=1; // uncomment to get parser to print out status + static char decimal_char; + // Finds out decimal point used in current locale + // + // + void GetDecimalPoint (void) + { + char text[20]; + int i; + + sprintf (text, "%f", 0.1); + for (i=0; i<strlen (text); ++i) + if (!isdigit (text[i])) { + decimal_char= text[i]; + break; + } + printf ("decimal_char: %c\n", decimal_char); + } *************** *** 185,189 **** epos= pos; while (isdigit ((int) input[epos]) || isalpha ((int) input[epos]) ! || input[epos]=='.') ++epos; // we've got an 'entry', lets check it --- 202,206 ---- epos= pos; while (isdigit ((int) input[epos]) || isalpha ((int) input[epos]) ! || input[epos]==decimal_char) ++epos; // we've got an 'entry', lets check it Index: main.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/main.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** main.c 2 Dec 2004 20:29:54 -0000 1.13 --- main.c 22 Jun 2005 22:52:42 -0000 1.14 *************** *** 68,71 **** --- 68,74 ---- // initialize system vars InitializeSystemVars (); + + // Find decimal character for current locale + GetDecimalPoint (); } *************** *** 177,180 **** --- 180,184 ---- gnome_init (PACKAGE, VERSION, argc, argv); SetUpInterface (); + GetDecimalPoint (); gtk_main (); // start gtk loop |