Use decimal formatting for float Num.toStr

This commit is contained in:
Ayaz Hafiz 2022-07-13 12:35:49 -04:00
parent b7b9227675
commit 980c3f1421
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 16 additions and 16 deletions

View file

@ -760,8 +760,8 @@ pub fn exportFromFloat(comptime T: type, comptime name: []const u8) void {
}
fn strFromFloatHelp(comptime T: type, float: T) RocStr {
var buf: [100]u8 = undefined;
const result = std.fmt.bufPrint(&buf, "{}", .{float}) catch unreachable;
var buf: [400]u8 = undefined;
const result = std.fmt.bufPrint(&buf, "{d}", .{float}) catch unreachable;
return RocStr.init(&buf, result.len);
}