It is better to use `parse_currency` than `to_d`.  You did this in other places, but not here.  The main reason is that it is more robust agains weird characters that can appear in HTML.