jrsonnet icon indicating copy to clipboard operation
jrsonnet copied to clipboard

bug: std.format about g, f G is not right

Open He-Pin opened this issue 7 months ago • 0 comments

When testing std.format I found there are some tests been commented out.

std.assertEqual(std.format('%#.1g', [0.99]), '1.') &&
std.assertEqual(std.format('%#.1g', [1.95555]), '2.') &&
std.assertEqual(std.format('%#.4g', [0.99995]), '1.000') &&

and currently the sjsonnet and jrsonnet @CertainLach gives 0.0 for std.format('%#.1g', [0.99]), but google/jsonnet gives 1.

There are more tests about std.format lives in google/go-jsonnet

refs: https://github.com/databricks/sjsonnet/issues/398 too

He-Pin avatar May 20 '25 05:05 He-Pin