A translated value uses wrong decimal point in CSS height

I’m using the following to set a CSS properrty

.background-image-banner {height: <?php $height = ($page->bannerheight()->toFloat()) / 2; echo $height ?>px !important}

It works as expected in English, but when I switch the page to German, and the original value is an odd number, the translated version uses the 0,5 decimal marker, not 0.5, and the CSS doesn’t work.

Can I either override that localisation somewhere, or is there a rounddown modifier?

You can set the locale for numbers in your German language file, which would only make sense if you don’t use any other numbers.

Otherwise you can use round($height).

Thank you, rounding is my solution here.