Changed to using sprintf, simplified extracting dc and shortened return