format currency properly

Fixes #869