monetary_to_number: Convert monetary character-strings to numeric values

monetary_to_numberR Documentation

Convert monetary character-strings to numeric values

Description

Convert monetary character-strings to numeric values

Usage

monetary_to_number(x)

Arguments

x

Character string to convert

Value

Returns number with value, stripped from any currency symbols and thousand-seperators (i.e. "B#2,010.50" becomes 2010.5)

Examples


monetary_to_number ("$2,200.20")

# Note that values using German or Dutch notation (i.e. using a comma to
  separate decimals and a dot to seperate thousands) are converted as well.
  monetary_to_number ("$2.200,20")


lshtm-vimc/prime documentation built on April 21, 2024, 3:21 a.m.