Skip to content

Commit

Permalink
feat: Added @BenWilliams-NOAA comma function from the AFSC safe pac…
Browse files Browse the repository at this point in the history
…kage.
  • Loading branch information
sbreitbart-NOAA authored and Schiano-NOAA committed Feb 24, 2025
1 parent 31cec28 commit 56ab69a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions R/comma.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Comma: format table numbers

#' Function to format numbers to text with 1,000s of commas.
#' This function was copied with permission from Ben Williams,
#' a NOAA Research Fisheries Biologist, as part of the AFSC SAFE
#' reporting tool.
#'
#' @param number value to format
#'
#' @export comma
#'
comma <- function( number ) {
format(round(as.numeric( number ), digits = 0), big.mark = ",")
}

0 comments on commit 56ab69a

Please sign in to comment.