On Mon, 22 Sep 2025 10:49:03 +1000 Duncan Roe wrote:
> Indeed. I was thinking about a previous post where someone suggested printf,
> which could round the answer to less digits. That's what you want isn't it?
There's printf in Bash, and there's printf in C. Why would I have to do
it in Bash, when the correct output can come directly from the C program?
Besides, I can't readily clean up the trailing zeros with printf, I will
still have to do some extra juggling on top of that, to get the answer "0.3".
And no, I can't simply tell printf to print me only one digit after the dot,
because I don't know beforehand how many digits the answer will have.