Help with TTS; limiting decimal places read aloud

Hello, I’m looking for some help with TTS, how to limit the number of decimal places that are read by TTS from an entity.
TTS would read the the two additional decimal places from my (ecowitt) sensor.
“Outdoor temp is thirty four point two five”
I’d like to only use/hear the whole number.
I created a sum helper, and set the accuracy to 0 decimals, thinking quick fix. Helper_Sum does change to the whole number, but also includes decimal/zero. (34.0) which is also read by TTS.
Unrelated, I’d also prefer to hear TTS read the time in 12hr format.

Appreciate any help or links to point me in the right direction.
Thanks for reading.

Simple, but here it is.

service: tts.xiaomo_say
data:
  entity_id: media_player.group_speaker_cast_whole_house
  message: >-
    The time is {{states('sensor.time')}}.  The temperature
    outside is {{states ('sensor.mean_sum_ecowitt_outside_temp')}} degrees.
service: tts.xiaomo_say
data:
  entity_id: media_player.group_speaker_cast_whole_house
  message: >-
    The time is {{ now().strftime("%-I:%M")}}.  The temperature
    outside is {{ states('sensor.mean_sum_ecowitt_outside_temp') | int }} degrees.

* If you want the TTS to specify am/pm add %p to the end of the format string in the strftime function.

Thank you very much, I really appreciate the help!
just started reading about templates, still slightly overwhelming for me grasp.

Thanks again-

Take it from someone who had no previous programming or CS training… In the beginning it’s overwhelming and confusing, but keep at it. The ability to use templates makes HA so much more capable and powerful than most other platforms.

1 Like

As luck would have it, this month update (2023.3) of HA allows you to change the number of decimal places displayed for sensors… Many thanks to @emontnemery for adding this feature!

Home Assistant release 2023.3 - Sensor Display Precision

Formatting Sensor States