Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ant6n
on Aug 26, 2015
|
parent
|
context
|
favorite
| on:
Python Extension Proposal 498: Literal String Form...
I switch back and forth between format and %, and never use
locals in the format. It's annoying, every time a string is written, to try to decide which way is better for this instance. That said, is there a way to do ('%.3f' % x) with this?
JoshTriplett
on Aug 26, 2015
[–]
f'{x:.3f}'
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: