better sprintf formatting for floats

When outputing a float to some number of decimal places, some
calculations are done with native numbers and others with bigints. This
results in odd formatting once intermediate calculations generate a
number that's too big to fit in a num.

This commit reworks the stringify-to-precision() routine to treat the
number as a string and then use only bigints for the individual parts.

Fixes RT #120232
Only output trailing dot if there are also trailing digits
Decimal expand numbers given in scientific notation

C<sprintf()> outputs strange numbers, sometimes with 2 radix points or
extra stuff on the end, when given a number in scientific notation to
format. So, prior to formatting, expand the number into the appropriate
decimal representation.