Hacker News new | ask | show | jobs
by majewsky 1936 days ago
Probably not even rounding, but just printf. The following works on my zsh:

  $ printf '%.0f°\n' 0.3
  0°
  $ printf '%.0f°\n' -0.3
  -0°
1 comments

That actually is rounding around zero (to zero decimal places, but it is rounding).
You're right. What I meant to say was that it's possible the programmers working on the weather app didn't add explicit rounding, they just passed the value through a formatter that did the rounding implicitly.