Browse Source

fix for php + use native ints

Nicolas Cannasse 13 năm trước cách đây
mục cha
commit
afa273db3d
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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();
 			}