mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Use decimal formatting for float Num.toStr
This commit is contained in:
parent
b7b9227675
commit
980c3f1421
2 changed files with 16 additions and 16 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue