Changing Million/Billion abbreviations into actual numbers? ie. 5.12M -> 5,120,000 [duplicate]

You can try this

num <- c("1.23M", "15.69B", "123.999M")
num <- gsub('B', 'e9', num)
num <- gsub('M', 'e6', num)
format(as.numeric(num), scientific = FALSE, big.mark = ",")

"84,060,000" "30,120,000,000" "251,290,000"

Leave a Comment