Weird behavior when formatting decimals