I want to make a function that determines how to print a number pulled from a database. The number represent the number of baths in a house. So, the number will either be a whole number or have .5 decimal (a half bath).
What I want is if the house has no half bath for it to print the number with no decimal so if the number is 2.0 I want it to print 2, but if the number is 2.5 just to leave it be and print it as is.
I am pretty new to PHP, and I taught myself from a text book. So, not knowing many ways to do it off hand, I have a lot of trouble when it comes to making my own functions. I really appreciate the help.
Thanks!