perl, get rid of exponential notation

rgbcof
rgbcof used Ask the Experts™
on
$val1 =             "0.000001";
$val2 = $val1 + "0.00001";
print "val2 = $val2\n";  # it prints out 1.1e-05

#How do I get it to print "0.000011"
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2014
Top Expert 2015
Commented:
printf "val2 = %.6f\n",$val2;

Author

Commented:
perfect

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial