"""Animations for changing numbers."""from__future__importannotations__all__=["ChangingDecimal","ChangeDecimalToValue"]importtypingfrommanim.mobject.text.numbersimportDecimalNumberfrom..animation.animationimportAnimationfrom..utils.bezierimportinterpolate
[docs]classChangingDecimal(Animation):def__init__(self,decimal_mob:DecimalNumber,number_update_func:typing.Callable[[float],float],suspend_mobject_updating:bool|None=False,**kwargs,)->None:self.check_validity_of_input(decimal_mob)self.number_update_func=number_update_funcsuper().__init__(decimal_mob,suspend_mobject_updating=suspend_mobject_updating,**kwargs)defcheck_validity_of_input(self,decimal_mob:DecimalNumber)->None:ifnotisinstance(decimal_mob,DecimalNumber):raiseTypeError("ChangingDecimal can only take in a DecimalNumber")