bazelbuild / starlark

Starlark Language
Apache License 2.0
2.38k stars 158 forks source link

Incomplete string format, lack support of "%.02f" #262

Open Turnkeys opened 11 months ago

Turnkeys commented 11 months ago

Python:

Python 3.11.3 (main, May  3 2023, 23:19:07) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print("%.02f" % (1/3))
0.33
>>> print("%f" % (1/3))
0.333333
>>>

Starlark:

Welcome to Starlark (go.starlark.net)
>>> print("%.02f" % (1/3))
Traceback (most recent call last):
  <stdin>:1:15: in <expr>
Error: unknown conversion %.
>>> print("%f" % (1/3))
0.333333
>>>

Reference to https://github.com/google/starlark-go/issues/493

Adrian-Samoticha commented 10 months ago

Related: https://github.com/bazelbuild/starlark/issues/232