glue icon indicating copy to clipboard operation
glue copied to clipboard

signif() transformer example

Open zeehio opened this issue 2 years ago • 0 comments

Hi,

Thanks for the glue package.

I wrote a transformer to format numbers with a fixed number of significant figures. I used a function generator to do that, which is a convenient approach if we want all glued variables to have the same number of significant digits. I think this approach is not shown in the vignette, and it is worth so the example I added (a) introduces a new strategy for working with transformers and (b) provides an example to show a fixed number of significant figures.

Besides I converted some of the transformers in the vignette so they use the identity_transformer() helper function. I had no idea how transformers worked, and the eval..parse stuff was a bit confusing compared to just using the identity_transformer() helper.

If you like it, feel free to merge it.

Thanks again for your time and work!

zeehio avatar Apr 26 '22 08:04 zeehio