On 07/07/18 08:50 AM, Carlos E. R. wrote:
Do we have something that would round a number in a script?
In a Ruby script there is the numeric function 'floor()' that does all of what you describe. I see that it is also available in the POSIX compatibility module for Perl. There is a similar function in Python. The bash shell doesn't, it seems, do floating point arithmetic. of course the older ksh does --- for i in 72.0009 86.0044 96.01 240.005 do ksh93 -c "print $(( floor($i) ))" done ---- OOPS! have to start that in ksh93 anyway as bash upchuks on things like "72.0009". So, we've taken a step backwards with using Bash? -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org