# NOT RUN {
# format_currency("2423562534234", "$")
# "$2,423,562,534,234"
# format_currency("2423562534234.876", "$", 0)
# "$2,423,562,534,234.88"
# format_currency("2423562534234.876", "$", 2)
# "$2,423,562,534,234.88"
# format_currency("2423562534234", "<U+00A5>", 2)
# "<U+00A5>2,423,562,534,234.00"
# format_currency() is vectorized and can accept vector arguments
format_currency(c("2423562534234", "20"), c("<U+00A5>", "$"), c(1, 2))
# "<U+00A5>2,423,562,534,234.0" "$20.0"
# }
Run the code above in your browser using DataLab