Index: src/cr-tknzr.c
===================================================================
RCS file: /cvs/gnome/libcroco/src/cr-tknzr.c,v
retrieving revision 1.23
diff -u -p -u -r1.23 cr-tknzr.c
--- src/cr-tknzr.c	29 May 2004 23:37:27 -0000	1.23
+++ src/cr-tknzr.c	2 Mar 2006 00:52:11 -0000
@@ -27,6 +27,7 @@
  *class.
  */
 
+#include <math.h>
 #include "string.h"
 #include "cr-tknzr.h"
 #include "cr-doc-handler.h"
@@ -1487,9 +1488,9 @@ cr_tknzr_parse_num (CRTknzr * a_this, 
         gboolean parsing_dec = FALSE,
                 parsed = FALSE;
         guint32 cur_char = 0,
-                int_part = 0,
-                dec_part = 0,
                 next_char = 0;
+        gdouble val = 0.0;
+        gint decimal_places = 0;
         CRInputPos init_pos;
         CRParsingLocation location = {0} ;
 
@@ -1500,7 +1501,7 @@ cr_tknzr_parse_num (CRTknzr * a_this, 
         RECORD_INITIAL_POS (a_this, &init_pos);
         READ_NEXT_CHAR (a_this, &cur_char);        
         if (IS_NUM (cur_char) == TRUE) {
-                int_part = int_part * 10 + (cur_char - '0');
+                val = val * 10 + (cur_char - '0');
 
                 parsed = TRUE;
         } else if (cur_char == '.') {
@@ -1532,9 +1533,10 @@ cr_tknzr_parse_num (CRTknzr * a_this, 
                         parsed = TRUE;
 
                         if (parsing_dec == FALSE) {
-                                int_part = int_part * 10 + (cur_char - '0');
+                                val = val * 10 + (cur_char - '0');
                         } else {
-                                dec_part = dec_part * 10 + (cur_char - '0');
+                                decimal_places++;
+                                val = val + ((cur_char - '0') / pow(10, decimal_places));
                         }
                 } else {
                         break;
@@ -1549,10 +1551,6 @@ cr_tknzr_parse_num (CRTknzr * a_this, 
          *Now, set the output param values.
          */
         if (status == CR_OK) {
-                gdouble val = 0.0;
-
-                val = int_part;
-                val += cr_utils_n_to_0_dot_n (dec_part);
                 if (*a_num == NULL) {
                         *a_num = cr_num_new_with_val (val, val_type);
 
