Allow floats values to use integer constants
parent
9b92fcea44
commit
511e3d5d88
|
@ -669,6 +669,8 @@ fn float(value_opt: ?std.json.Value) ?f64 {
|
||||||
const value = value_opt orelse return null;
|
const value = value_opt orelse return null;
|
||||||
return switch (value) {
|
return switch (value) {
|
||||||
.Float => |float| float,
|
.Float => |float| float,
|
||||||
|
// Integers are valid floats
|
||||||
|
.Integer => |int| @intToFloat(f64, int),
|
||||||
else => null,
|
else => null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue