How to remove decimal zero
Posted: Thu Apr 22, 2021 12:32 pm
Hello,
I am trying to achieve the following functionality to display my TCAS range:
txt_set(txt_range, 74/milestopixels)
The problem is, that if the result is a whole number, the resulting text contains a decimal zero.
Current functionality:
result = 10 -> shown text = 10.0
result 2.5 -> shown text = 2.5
Required functionality:
result = 10 -> shown text = 10 (without decimal zero)
result 2.5 -> shown text = 2.5
Anybody has an easy solution please?
Thank you!
Pavel
I am trying to achieve the following functionality to display my TCAS range:
txt_set(txt_range, 74/milestopixels)
The problem is, that if the result is a whole number, the resulting text contains a decimal zero.
Current functionality:
result = 10 -> shown text = 10.0
result 2.5 -> shown text = 2.5
Required functionality:
result = 10 -> shown text = 10 (without decimal zero)
result 2.5 -> shown text = 2.5
Anybody has an easy solution please?
Thank you!
Pavel