Given a number, return a string formatted in terms of millions of dollars.

dollar_millions(x)

Arguments

x

A number.

Value

String in the format of $xM.

Examples

dollar_millions(1.523 * 10^6)
#> [1] "$1.52M"