Learn R Programming

lucr (version 0.2.0)

from_currency: Convert currency-formatted strings into numeric values

Description

takes a vector of strings formatted as amounts of money ("$12,329.34") and reformats them as numeric values (12329.34).

Usage

from_currency(x, decimal_delim = ".")

Arguments

x
a vector of strings, formatted as money amounts. See to_currency.
decimal_delim
the character used to delimit the decimal amount. Set to "." by default.

Examples

Run this code
from_currency("£1,249.34")
# [1] 1249.34

Run the code above in your browser using DataLab