Converts a double to a Decimal that can then be rendered in several ways. Unlike toString this always returns a Decimal, so it is only defined for finite numbers.