Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Rounding to X digits
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Robert Klemme, post: 4446002"] *Hands over some cooling ice* :-) The difference in efficiency is one issue. But there is a conceptual difference: it depends whether you want to align printed output or round a numeric value in a calculation. For the first task sprintf is probably better because the amount of places printed is guaranteed (by the format string), while it's not if you just round the number and print it. Kind regards robert [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Rounding to X digits
Top