mirror of
https://github.com/zoriya/xmlParser.git
synced 2026-06-04 02:36:19 +00:00
Fixing a bug with floats
This commit is contained in:
+2
-1
@@ -8,6 +8,7 @@
|
|||||||
#include "xml.h"
|
#include "xml.h"
|
||||||
#include "xml_internal.h"
|
#include "xml_internal.h"
|
||||||
#include "my.h"
|
#include "my.h"
|
||||||
|
#include "math.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
char *xml_getproperty(node *n, const char *key)
|
char *xml_getproperty(node *n, const char *key)
|
||||||
@@ -44,7 +45,7 @@ float xml_getfloatprop(node *n, const char *key)
|
|||||||
prop += get_int_size(nbr);
|
prop += get_int_size(nbr);
|
||||||
if (*prop) {
|
if (*prop) {
|
||||||
deci = my_getnbr(prop + 1);
|
deci = my_getnbr(prop + 1);
|
||||||
nbr += deci / (float)(get_int_size(deci) * 10);
|
nbr += deci / pow(10, (float)get_int_size(deci));
|
||||||
}
|
}
|
||||||
return (nbr);
|
return (nbr);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user