Fixed quantity formatting function

Hey dude,

I fixed the formatting function this time correctly. It mimics the Android client.