R/print_money.R

Defines functions print_money

Documented in print_money

#' Format numeric to currency for output
#' @description{
#' print_money formats numerics to currency for out put in shiny app
#' }
#' @param x Numeric
#'
#' @export
#'
#' @return numeric with 2 decimal places and big.mark comma
#'
#' @examples
#' print_money(14857)
#' # returns 14,857.00
#'
print_money <- function(x){
  format(x, digits = 10, nsmall = 2, decimal.mark = ".", big.mark = ",")
}
themechanicalbear/mobstrs documentation built on Dec. 31, 2020, 8:35 a.m.