in reply to Decimal rounding
How do I print/round a number to a given number of decimal places? is the question you were looking for. Check out sprintf for the juicy details :)
print sprintf("%.1f", 490.408163265306), "\n"; # 1 decimals print sprintf("%.2f", 490.408163265306), "\n"; # 2 decimals print sprintf("%.3f", 490.408163265306), "\n"; # 3 decimals
Update: Aw, got beat like usual.
If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, reply to this node or /msg me to tell me what is wrong with the post, so that I may update the node to the best of my ability. If you do not inform me as to why the post deserved a downvote, your vote does not have any significance and will be disregarded.
|
|---|