bazelbuild / starlark

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

Add precision specifier for %f, %g, %G string interpolation formats #232

Open tetromino opened 1 year ago

tetromino commented 1 year ago

Now that Starlark has gained support for floating point, it makes sense to revisit the decision to not allow width or precision specifiers for % string interpolation formats.

This would be particularly useful for the java implementation of Starlark, where java.util.Formatter's default precision is 6 - meaning "%f" % 2" is currently "2.000000" instead of "2.0".