Perl 6, 5757 44 bytes
{S[\$!=m/\.<(/.to;.=substr(\d0,$!+$/)*]=[~] $0[^reducewhile {$^a>($^b&++$)??$b!!$a},$0]m:c/\d/}
Try it online!Try it online!
Modifies a string in-place.
Explanation
{
S[ # replace regex match
$!=m/\. # literal dot
<( # start match
/.to; (\d)* # Store sequenceposition of digits,decimal storedpoint in $0
]= # with
[~] # concatenation of
$0[^ # digits up to
reduce { # reduce digits$!
$^a>.=substr($^b&++$0,$!+$/) # if digit andTruncate indexstring lessto thanlength acc$!+$/
??$b while m:c/\d/ # then digit
!!$a while #there's elsea accumulator
match for the },$0
next ]digit
}