Serialize float options using the hexadecimal format

This ensures no information is lost when the value is round-tripped.
This commit is contained in:
Carl Åstholm
2025-03-24 13:22:08 +01:00
parent 5380e81924
commit e7604bba3e
2 changed files with 12 additions and 6 deletions

View File

@@ -507,7 +507,7 @@ fn addUserInputOptionFromArg(
.comptime_float, .float => return if (maybe_value) |v| {
map.put(field.name, .{
.name = field.name,
.value = .{ .scalar = std.fmt.allocPrint(arena, "{e}", .{v}) catch @panic("OOM") },
.value = .{ .scalar = std.fmt.allocPrint(arena, "{x}", .{v}) catch @panic("OOM") },
.used = false,
}) catch @panic("OOM");
},