Gt: Add a format function to generate fractions from numbers

Created on 19 Nov 2019  Â·  2Comments  Â·  Source: rstudio/gt

This is one of the best packages in R. Thanks so much for making it!

My idea is to make fractions from numbers. Where if you had 0.5, it becomes 1/2, 2.33 becomes 2 33/100 (or 2 1/3, depending on the accuracy which could be 1, 2, 3 digits in the denominator). You could also specify that the denominator must be of a certain type (1/3s, 1/2s, 1/4s, 1/8s).

[2] Intermediate [3] High [2] Medium ★ Enhancement

Most helpful comment

This could become fmt_fraction() and based on these requirements it doesn’t look too difficult. Thanks for the feature request!

All 2 comments

This could become fmt_fraction() and based on these requirements it doesn’t look too difficult. Thanks for the feature request!

The amount of formatters in this package is really impressive and I think this would be a great one. Honestly, if you would just keep adding more formatters it would only increase the value proposition of the whole project!

Was this page helpful?
0 / 5 - 0 ratings