Title: RE: Need help with what should be simple math
 > And what if I want to store it on a variable. Maybe I missed something while explaining. I will reformat this number later on with a function that takes the value as a string to cut it off and reformat it. So how can I store the value of zero since it's .00000[manyzeros]681, which is really 0 as far as my precision goes. Because the printf will output the value but I need to capture it on a variable. 
 
If you want to "preserve the zeros", you have to prevent the conversion to numeric context. zat help?
 
$x =   0.00000000000000000681     . "\n";  # numeric context; zeros lost
$y = " 0.00000000000000000681\n";          # string  context; zeros preserved
print $x; # |6.81e-018
print $y; # | 0.00000000000000000681
 

 

 

 

Reply via email to