Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String format not supported #209

Closed
Michael-F-Ellis opened this issue Mar 11, 2023 · 3 comments
Closed

String format not supported #209

Michael-F-Ellis opened this issue Mar 11, 2023 · 3 comments

Comments

@Michael-F-Ellis
Copy link

% codon --version
0.15.5
% echo 'print("hello")' | codon run
hello
% echo 'print("{}".format(1.23))' | codon run
<stdin>:1:7-24: error: 'str' object has no attribute 'format'
@arshajii
Copy link
Contributor

Thanks for the report -- we do plan to add this in a future version. For now f-strings can be used as a workaround:

x = 1.23
print(f"hello {x:.6f} world")  # hello 1.230000 world

@JinChengneng
Copy link

I've experienced the same issue and appreciate the workaround. I'm hopeful that a permanent fix will be available soon.

@inumanag
Copy link
Contributor

Merging into #608 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants