
Format numeric columns to align at decimal point without trailing zeroes
Source:R/fmt_pad_num.R
fmt_pad_num.Rd
This function removes repeating trailing zeroes and adds blank white space
to align at the decimal point. This requires the use of true monospaced fonts,
which are supplied via the gt::google_font()
function. This is a wrapper
around gt::fmt()
and gtExtras::pad_fn()
.
Arguments
- gt_object
An existing gt table object of class
gt_tbl
- columns
The columns to format. Can either be a series of column names provided in
c()
, a vector of column indices, or a helper function focused on selections. The select helper functions are:starts_with()
,ends_with()
,contains()
,matches()
,one_of()
,num_range()
, andeverything()
.- nsmall
The max number of decimal places to round at/display
- gfont
The complete name of a font available in Google Fonts. For the
fmt_pad_num
function this requires a monospaced font, where Google has many available at fonts.google.com
See also
Other Utilities:
add_text_img()
,
fa_icon_repeat()
,
fmt_pct_extra()
,
fmt_symbol_first()
,
generate_df()
,
gt_add_divider()
,
gt_badge()
,
gt_double_table()
,
gt_duplicate_column()
,
gt_fa_column()
,
gt_fa_rank_change()
,
gt_fa_rating()
,
gt_fa_repeats()
,
gt_highlight_cols()
,
gt_highlight_rows()
,
gt_img_circle()
,
gt_img_rows()
,
gt_index()
,
gt_merge_stack()
,
gt_two_column_layout()
,
gtsave_extra()
,
img_header()
,
pad_fn()
,
tab_style_by_grp()