Description Usage Arguments Examples
This function takes a text string and extracts the dollar amount identified as numeric, allowing the suffixes K (thousand), M (million), B (billion), and T (trillion)
1 | ExtractCurrency(string, debug = FALSE)
|
string |
String to search for dollar amounts |
debug |
If |
1 2 3 4 5 6 7 8 9 10 | ExtractCurrency('$11')
ExtractCurrency('$100 total')
ExtractCurrency('Receipt of $11.57')
ExtractCurrency('$10K-$100K', debug = TRUE) # Returns 10,000 (first match)
strings <- c('Nearly $23K', 'A $200M Powerball', 'A $3B endowment', 'GDP last year of $17.1T (USD)')
ExtractCurrency(strings, debug = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.