Skip to content

Commit f28c010

Browse files
committed
Merge pull request #192 from sparkprime/fix_format_percent
Fix #190
2 parents bd6ae83 + 45918f4 commit f28c010

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stdlib/std.jsonnet

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,12 @@ limitations under the License.
546546
pad_right(s, tmp.fw, " ")
547547
else
548548
pad_left(s, tmp.fw, " ");
549-
format_codes_arr(codes, arr, i + 1, j2 + 1, v + s_padded) tailstrict;
549+
local j3 =
550+
if code.ctype == "%" then
551+
j2
552+
else
553+
j2 + 1;
554+
format_codes_arr(codes, arr, i + 1, j3, v + s_padded) tailstrict;
550555

551556
// Render a parsed format string with an object of values.
552557
local format_codes_obj(codes, obj, i, v) =

0 commit comments

Comments
 (0)