Explorar el Código

fix for php + use native ints

Nicolas Cannasse hace 13 años
padre
commit
afa273db3d
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      std/haxe/Json.hx

+ 3 - 1
std/haxe/Json.hx

@@ -255,7 +255,9 @@ class Json {
 					throw "Invalid float at position "+pos;
 				var v = reg_float.matched(0);
 				pos += v.length;
-				return Std.parseFloat(v);
+				var f = Std.parseFloat(v);
+				var i = Std.int(f);
+				return if( i == f ) i else f;
 			default:
 				invalidChar();
 			}