(self, digitstr, exp10, digits_to_dot, force_dot, group_digits=False)
return valstr
Put digits in scientific E-notation.
Put digits in scientific E-notation.
Put digits in scientific E - notation .
def _scientific_notation(self, digitstr, exp10, digits_to_dot, force_dot, group_digits=False):
        """Put digits in scientific E-notation."""
        valstr = digitstr[:digits_to_dot]
        if group_digits:
            valstr = self._group_digits(valstr)
        if len(digitstr) > digits_to_dot:
            after_str = digitstr[digits_to_dot:]
            valstr += b'.' + after_str
        elif len(digitstr) == digits_to_dot and force_dot:
            valstr += b'.'
        exponent = exp10 - digits_to_dot + 1
        valstr += self.exp_sign
        if exponent < 0:
            valstr += b'-'
        else:
            valstr += b'+'
        valstr += _get_digits(abs(exponent), n_digits=2, remove_trailing=False)
        return valstr
def _scientific_notation ( self , digitstr , exp10 , digits_to_dot , force_dot , group_digits = False ) : valstr = digitstr [ : digits_to_dot ] if group_digits : valstr = self . _group_digits ( valstr ) if len ( digitstr ) > digits_to_dot : after_str = digitstr [ digits_to_dot : ] valstr += b'.' + after_str elif len ( digitstr ) == digits_to_dot and force_dot : valstr += b'.' exponent = exp10 - digits_to_dot + 1 valstr += self . exp_sign if exponent < 0 : valstr += b'-' else : valstr += b'+' valstr += _get_digits ( abs ( exponent ) , n_digits = 2 , remove_trailing = False ) return valstr