Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Is it possible to convert an Int to a String at comp time? - Modular
M
Modular
•
2y ago
•
13 replies
toasty
Is it possible to convert an Int to a String at comp time?
Hey all
, I
'm trying to make some comp time friendly structs for my project
. I
'm struggling with converting an int to a string for some string concatenations
.
str()
str()
does not work at comp time
.
Minimal example to reproduce the error
.
fn main() -> None:
alias s = str(1)
fn main() -> None:
alias s = str(1)
Modular
Join
This server is the home of the MAX and Mojo community! Join us to chat about all things Modular.
20,199
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Branchless way to convert bool to int?
M
Modular / questions
3y ago
Type system does not recognize that a literal int is equal to an Int alias
M
Modular / questions
3y ago
How to convert string to float value?
M
Modular / questions
3y ago
How can I convert String to StringLiteral
M
Modular / questions
2y ago