///
/// Given HTML overlay for an image in the store, render it.
/// [p:n] renders as price for item ID n
///
/// Rendere
You can only use the $1
notation if the replacement
argument is a string, so you ended up passing $1
as a literal string to the int.Parse
method.
Instead, use the (String, String, MatchEvaluator) overload with an anonymous method:
Regex.Replace(overlayHTML, pattern,
match => FormatCurrency(GetItemPriceOnDate(DateTime.Now, currencyID, int.Parse(match.Groups[1].Value)))
)