To further your answer.
The variable was probably not empty when not rounding it but something big like, for example, "1.13548341583454132138534436415438" (a random float number).
If your text object is not wide enough, it won't display the text and appear as "empty", when it actually isn't.
Rounding the number makes sure it's either 1, 2 or 3 and so will be displayed.