starlarky icon indicating copy to clipboard operation
starlarky copied to clipboard

String formatting with padding characters not supported in Larky

Open mottersheadt opened this issue 2 years ago • 1 comments

Problem or feature statement

Currently Larky does not support string formatting with padding characters. For example, "%02x" % 3 should return "03".

Advised solution

Implement more advanced pythonic string formatting features in Larky.

Testing scenarios

"%02x" % 3 == "03"
"%03x" % 3 == "003"
"%04x" % 3 == "0003"
"%2s" % 3 == " 3"
"%010d" % 3 == "0000000003"

mottersheadt avatar May 24 '22 05:05 mottersheadt