Hi friends,
I'm very new to perl and got some requirement.
I've input numbers which has size of 17 characters [including +/- sign and .] like below:
-22500.0000000000
58750.00000000000
4944.000000000000
-900.000000000000
272.0000000000000
I need to convert these numbers from negative to positive and positive to negative. After the conversion again I need to get 17 characters.
After some googling below is the part of the script I've written.
$num = -22500.0000000000
$num = sprintf("%17f" - $num);
But this is not giving me the desired output. My requirement to the above numbers should be as below:
22500.00000000000
-58750.0000000000
-4944.00000000000
900.0000000000000
-272.000000000000
Could any one help me please?
Thanks and Regards,
Mysore Ganapati