def _places_b4_and_after_decimal(d):
    """
    >>> _places_b4_and_after_decimal(Decimal('54.212'))
    (2, 3)
    """
    tup = d.as_tuple()
    return len(tup.digits) + tup.exponent, max(-1 * tup.exponent, 0)
