You could always write a regular expression and see how many digits the number has and then base your answer on the return for the regexp.
if ($digit =~ /\d{6}/)
{
print "use bigfloat\n";
}
Comment on Re: Determining when Math::BigFloat is necessary?